Skip to content

Commit 9eb5e22

Browse files
Jenkinsopenstack-gerrit
Jenkins
authored andcommitted
Merge "Fixed policy check for manila api."
2 parents 208f51a + 70c5541 commit 9eb5e22

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

manila/share/api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def check_policy(context, action, target_obj=None):
6464
'project_id': context.project_id,
6565
'user_id': context.user_id,
6666
}
67-
target.update(target_obj if isinstance(target_obj, dict) else {})
67+
target.update(target_obj or {})
6868
_action = 'share:%s' % action
6969
manila.policy.enforce(context, _action, target)
7070

@@ -77,11 +77,10 @@ def __init__(self, db_driver=None):
7777
self.share_rpcapi = share_rpcapi.ShareAPI()
7878
super(API, self).__init__(db_driver)
7979

80-
@wrap_check_policy
8180
def create(self, context, share_proto, size, name, description,
8281
snapshot=None, availability_zone=None):
8382
"""Create new share."""
84-
83+
check_policy(context, 'create')
8584
if snapshot is not None:
8685
if snapshot['status'] != 'available':
8786
msg = _('status must be available')

0 commit comments

Comments
 (0)