diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-01-08 17:35:54 -0600 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-01-10 18:20:04 -0600 |
commit | 8b2fe985ddf29a490fef0fc2b76d6a6ac2d566fd (patch) | |
tree | f7eb12962d01b81fafa3e2450b90763f46f6b5b4 /lib/api/helpers.rb | |
parent | a0f77090854b3510543dc42529d7353adab03da0 (diff) | |
download | gitlab-ce-8b2fe985ddf29a490fef0fc2b76d6a6ac2d566fd.tar.gz |
Restrict multiple clusters through API
Modifies authorize! method to accept a third param, and then use it in
combination with 'add_cluster' policy to appropriately restrict adding
multiple clusters
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56110
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 74927b4db81..fa6c9777824 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -235,8 +235,8 @@ module API forbidden! unless current_user.admin? end - def authorize!(action, subject = :global) - forbidden! unless can?(current_user, action, subject) + def authorize!(action, subject = :global, reason = nil) + forbidden!(reason) unless can?(current_user, action, subject) end def authorize_push_project |