:py:mod:`auth` ============== .. py:module:: auth .. autoapi-nested-parse:: Module for authentication and authorization Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: auth.Permissions auth.PermissionUtils Functions ~~~~~~~~~ .. autoapisummary:: auth.has_document_permission auth.has_project_permission auth.has_system_user_permission Attributes ~~~~~~~~~~ .. autoapisummary:: auth.document_map auth.project_map auth.system_map .. py:class:: Permissions Bases: :py:obj:`str`, :py:obj:`enum.Enum` Enum for permissions .. py:attribute:: create :annotation: = create .. py:attribute:: view :annotation: = view .. py:attribute:: edit :annotation: = edit .. py:attribute:: delete :annotation: = delete .. py:attribute:: edit_permissions :annotation: = edit_permissions .. py:class:: PermissionUtils(session, user_name, project_name = None, document_name = None) Helper class that provides methods for checking permissions .. py:method:: has_sys_perm(self, permission) .. py:method:: has_proj_perm(self, permission) .. py:method:: has_doc_perm(self, permission) .. py:data:: document_map .. py:function:: has_document_permission(session, user, project, document, permission) Checks if a user has a permission on a document :param session: session to use :param user: user to check :param project: project of document :param document: document to check :param permission: permission to check :return: True if user has permission, False otherwise .. py:data:: project_map .. py:function:: has_project_permission(session, user, project, permission) Checks if a user has a permission on a project :param session: session to use :param user: user to check :param project: project to check :param permission: permission to check :return: True if user has permission, False otherwise .. py:data:: system_map .. py:function:: has_system_user_permission(session, user, permission) Checks if a user has system permission :param session: session to use :param user: user to check :param permission: permission to check :return: True if user has permission, False otherwise