summaryrefslogtreecommitdiff
path: root/app/controllers/clusters/base_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/clusters/base_controller.rb')
-rw-r--r--app/controllers/clusters/base_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/clusters/base_controller.rb b/app/controllers/clusters/base_controller.rb
index b1ffdf00b87..f88d381b3bf 100644
--- a/app/controllers/clusters/base_controller.rb
+++ b/app/controllers/clusters/base_controller.rb
@@ -4,7 +4,7 @@ class Clusters::BaseController < ApplicationController
include RoutableActions
skip_before_action :authenticate_user!
- before_action :authorize_read_cluster!
+ before_action :authorize_admin_cluster!, except: [:show, :index, :new, :authorize_aws_role, :update]
helper_method :clusterable
@@ -18,11 +18,11 @@ class Clusters::BaseController < ApplicationController
end
def authorize_update_cluster!
- access_denied! unless can?(current_user, :update_cluster, cluster)
+ access_denied! unless can?(current_user, :update_cluster, clusterable)
end
def authorize_admin_cluster!
- access_denied! unless can?(current_user, :admin_cluster, cluster)
+ access_denied! unless can?(current_user, :admin_cluster, clusterable)
end
def authorize_read_cluster!