The openstack_dashboard.policy_backend
ModuleΒΆ
Policy engine for Horizon
-
openstack_dashboard.policy_backend.
check
(actions, request, target=None)[source] Check user permission.
Check if the user has permission to the action according to policy setting.
Parameters: - actions –
list of scope and action to do policy checks on, the composition of which is (scope, action)
- scope: service type managing the policy for action
- action: string representing the action to be checkedthis should be colon separated for clarity. i.e.compute:create_instancecompute:attach_volumevolume:attach_volume
for a policy action that requires a single action, actions should look like
“((“compute”, “compute:create_instance”),)”- for a multiple action check, actions should look like
- “((“identity”, “identity:list_users”),(“identity”, “identity:list_roles”))”
- request – django http request object. If not specified, credentials must be passed.
- target – dictionary representing the object of the action for object creation this should be a dictionary representing the location of the object e.g. {‘project_id’: object.project_id}
Returns: boolean if the user has permission or not for the actions.
- actions –
-
openstack_dashboard.policy_backend.
reset
()[source]