summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 3457a1ab1b4..f903c7fdd62 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -94,6 +94,14 @@ class ApplicationController < ActionController::Base
return access_denied! unless can?(current_user, :download_code, project)
end
+ def authorize_manage_user_team!
+ return access_denied! unless user_team.present? && can?(current_user, :manage_user_team, user_team)
+ end
+
+ def authorize_admin_user_team!
+ return access_denied! unless user_team.present? && can?(current_user, :admin_user_team, user_team)
+ end
+
def access_denied!
render "errors/access_denied", layout: "errors", status: 404
end
@@ -135,4 +143,5 @@ class ApplicationController < ActionController::Base
def dev_tools
Rack::MiniProfiler.authorize_request
end
+
end