Permissions

Functions used to control access to views (Permission Denied returned when false)
and to enable/disable interactions in the templates.

Default permissions module can be swapped out in settings. Defaults use django’s built in content_type permissions for the Document model.

Each function takes the request use and the view’s kwargs as arguments,
returns True iff user has the required permission for the given object(s).
document_catalogue.permissions.user_can_delete_document(user, **kwargs)[source]

Return True iff the given user can delete documents from the catalogue

document_catalogue.permissions.user_can_download_document(user, **kwargs)[source]

Return True iff the given user is allowed to download documents

document_catalogue.permissions.user_can_edit_document(user, **kwargs)[source]

Return True iff the given user can edit documents in the catalogue

document_catalogue.permissions.user_can_post_document(user, **kwargs)[source]

Return True iff the given user can upload new files to the catalouge

document_catalogue.permissions.user_can_view_document_catalogue(user, **kwargs)[source]

Return True iff given user is allowed to view the document catalogue