Update .get_inherited_permissions() to grab the permissions
of an object up the parent tree. Also add the role
permissions. Finally filter all the permissions by those
that apply to the object.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Convert the API to use viewsets.
The search function is now a service of the search model
resource.
The simple and advance search are now the same service. The
difference is determined by the URL query. A ?q= means a
simple search. For advanced search pass the search model
fields in the URL query, example: ?q=document_type__label=
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Reduce repeated code.
Add support for passing query string dictionary to
the test client.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Normalize API base names.
Update ViewSet base class, model classes are not needed
the OCR API views.
Split API tests into content and submit tests.
Puntuate view test strings.
Make use of success and title strings.
Make use of external object mixin in document type
settings view.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Add additional API and view tests.
Add success and multi document titles strings.
Make use of external mixin in the document type submit view.
Puntuate all view text strings.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Use viewsets for the events app API.
Use new link badge support for the unread notification
count display.
Remove AJAX workers support now that it is now needed
anymore.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Update serializers to be a subclass of
LazyExtraFieldsHyperlinkedModelSerializer to allow adding
more fields remotely.
Update URL fields to use MultiKwargHyperlinkedIdentityField.
Rename URL fields for uniformity.
Signed-off-by: Roberto Rosario <Roberto.Rosario.Gonzalez@mayan-edms.com>
Update the API routers registration to not duplicate
the document's URL parameter definition.
Signed-off-by: Roberto Rosario <Roberto.Rosario.Gonzalez@mayan-edms.com>
This refactor adds two new endpoints to view the OCR
content of versions and documents.
Signed-off-by: Roberto Rosario <Roberto.Rosario.Gonzalez@mayan-edms.com>
These views allow accesing the tags list of a document as
well as attaching or removing tags in bulk.
The URLs for tag list, attach and remove are added to the
DocumentSerializer.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This class is a mixin of LazyExtraFieldsSerializerMixin and
serializers.HyperlinkedModelSerializer. It allows adding fields
to a 3rd party app serializer without having to import the serializer.
Referencing is done using the dotted path of the serializer.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>