zope.security.management¶
Default zope.security.interfaces.ISecurityManagement
and
zope.security.interfaces.IInteractionManagement
implementation.
Note that this module itself provides those interfaces.
-
zope.security.management.
setSecurityPolicy
(aSecurityPolicy)[source]¶ 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.
-
exception
zope.security.management.
ExistingInteraction
[source]¶ Bases:
exceptions.ValueError
,exceptions.AssertionError
The exception that
newInteraction()
will raise if called during an existing interaction.
-
zope.security.management.
checkPermission
(permission, object, interaction=None)[source]¶ Return whether security policy allows permission on object.
Parameters: - 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.
Returns: A boolean value.
checkPermission
is guaranteed to returnTrue
if permission iszope.security.checker.CheckerPublic
orNone
.Raises: NoInteraction – If there is no current interaction and no interaction argument was given.