Note that this module itself provides those interfaces.
Get the system default security policy.
Set the system default security policy, and return the previous value.
This method should only be called by system startup code. It should never, for example, be called during a web request.
Return a current interaction, if there is one.
Get the current interaction.
The exception that
newInteraction()will raise if called during an existing interaction.
Start a new interaction.
End the current interaction.
checkPermission(permission, object, interaction=None)¶
Return whether security policy allows permission on object.
- permission (str) – A permission name.
- object – The object being accessed according to the permission.
- interaction – An interaction, providing access to information such as authenticated principals. If it is None, the current interaction is used.
A boolean value.
checkPermissionis guaranteed to return
Trueif permission is
NoInteraction – If there is no current interaction and no interaction argument was given.