This change allows filtering a queryset by multiple permission
following a logic operator to define the relationship.
Example: In order to access an instance of MetadataTypeDocumentType
the document type view and metadata type view permissions are
required. The computation for this access control can now be
coded using .restrict_queryset_by_accesses. Custom permission
checking in the view is no longer required.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
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>
Remove support for passing a related field argument when
checking for access for restricting a queryset.
Remove a duplicate permission check.
Fix bug when filtering the direct ACL for an object,
the ACL query was filtering by the ACL ID instead of the
object ID.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Rename all instance of `pk` or `acl_pk` to `acl_id`
to match the preferred URL parameter naming conventions of
using `id` instead of `pk`.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Now that the automatic OCR, parsing and file metadata processing
are turned off by the test setting file, these overrides in the
tests are not needed anymore.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Instead of inserting the path of the apps into the Python app,
the apps are now referenced by their full import path.
This app name claves with external or native Python libraries.
Example: Mayan statistics app vs. Python new statistics library.
Every app reference is now prepended with 'mayan.apps'.
Existing config.yml files need to be updated manually.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>