geonature.core.gn_permissions.tools#
Attributes#
Functions#
|
|
|
|
|
|
|
This function returns a set of all the permissions that match (action_code, id_role, module_code, object_code). |
|
This function gets the final scope permission. |
|
This function gets the scopes permissions for each one of the 6 actions in "CRUVED", |
|
This function return the scope for an action, a module and an object as a Boolean |
|
This function gets the scopes permissions for each one of the 6 actions in "CRUVED", |
Module Contents#
- geonature.core.gn_permissions.tools._get_permissions(id_role, module_code, object_code, action_code)[source]#
- geonature.core.gn_permissions.tools.get_permissions(action_code, id_role=None, module_code=None, object_code=None)[source]#
This function returns a set of all the permissions that match (action_code, id_role, module_code, object_code). If module_code is None, it is set as the code of the current module or as « GEONATURE » if no current module found. If object_code is None, it is set as the code of the current object or as « ALL » if no current object found.
:returns : the list of permissions that match, and an empty list if no match
- geonature.core.gn_permissions.tools.get_scope(action_code, id_role=None, module_code=None, object_code=None, bypass_warning=False)[source]#
This function gets the final scope permission.
It takes the maximum for all the permissions that match (action_code, id_role, module_code, object_code) and with of a « SCOPE » filter type.
:returns : (int) The scope computed for specified arguments
- geonature.core.gn_permissions.tools.get_scopes_by_action(id_role=None, module_code=None, object_code=None)[source]#
This function gets the scopes permissions for each one of the 6 actions in « CRUVED », that match (id_role, module_code, object_code)
:returns : (dict) A dict of the scope for each one of the 6 actions (the char in « CRUVED »)
- geonature.core.gn_permissions.tools.has_any_permissions(action_code, id_role=None, module_code=None, object_code=None) bool [source]#
This function return the scope for an action, a module and an object as a Boolean Use for frontend
- geonature.core.gn_permissions.tools.has_any_permissions_by_action(id_role=None, module_code=None, object_code=None)[source]#
This function gets the scopes permissions for each one of the 6 actions in « CRUVED », that match (id_role, module_code, object_code)
:returns : (dict) A dict of the boolean for each one of the 6 actions (the char in « CRUVED »)