diff --git a/openstack_dashboard/policy.py b/openstack_dashboard/policy.py index f0ddb56ebe..b19201932a 100644 --- a/openstack_dashboard/policy.py +++ b/openstack_dashboard/policy.py @@ -61,7 +61,7 @@ def reset(): _ENFORCER = None -def check(actions, request, target={}): +def check(actions, request, target=None): """Check user permission. Check if the user has permission to the action according @@ -98,6 +98,8 @@ def check(actions, request, target={}): {'project_id': object.project_id} :returns: boolean if the user has permission or not for the actions. """ + if target is None: + target = {} user = auth_utils.get_user(request) # Several service policy engines default to a project id check for