def check_policy(context, action, target_obj=None):
    target = {'project_id': context.project_id, 'user_id': context.user_id}
    target.update((target_obj or {}))
    _action = ('volume:%s' % action)
    cinder.policy.enforce(context, _action, target)
def check_policy(context, action, target_obj=None):
    target = {'project_id': context.project_id, 'user_id': context.user_id}
    target.update((target_obj or {}))
    _action = ('volume:%s' % action)
    cinder.policy.enforce(context, _action, target)