Skip to content

Commit

Permalink
Authorise action managing tenant quotas for according tenants
Browse files Browse the repository at this point in the history
  • Loading branch information
lpichler committed Jan 3, 2019
1 parent 5301b29 commit 5db50b5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/api/base_controller/renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,11 @@ def fetch_typed_subcollection_actions(method, is_subcollection)

def api_user_role_allows?(action_identifier)
return true unless action_identifier

if action_identifier == "rbac_tenant_manage_quotas"
action_identifier = MiqProductFeature.tenant_identifier(action_identifier, @req.collection_id)
end

Array(action_identifier).any? { |identifier| User.current_user.role_allows?(:identifier => identifier) }
end

Expand Down

0 comments on commit 5db50b5

Please sign in to comment.