zope.security.management

Default ‘ISecurityManagement’ and ‘IInteractionManagement’ implementation

zope.security.management.getSecurityPolicy()[source]

Get the system default security policy.

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.

zope.security.management.getInteraction()[source]

Get the current interaction.

zope.security.management.newInteraction(*participations)[source]

Start a new interaction.

zope.security.management.endInteraction()[source]

End the current interaction.

zope.security.management.checkPermission(permission, object, interaction=None)[source]

Return whether security policy allows permission on object.

‘permission’ is a permission name.

‘object’ is the object being accessed according to the permission.

‘interaction’ is an interaction, providing access to information such as authenticated principals. If it is None, the current interaction is used.

checkPermission is guaranteed to return True if permission is CheckerPublic or None.