diff options
| author | Andrey Kumanyaev <me@zzet.org> | 2013-01-23 02:20:27 +0400 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-24 22:31:25 +0200 |
| commit | 18bd1c9d30e16783d750c7786cbcc7d350f4d0aa (patch) | |
| tree | 6218758f723e827cf90ea61f7bc4ed639ad6cc54 /app/controllers/application_controller.rb | |
| parent | 7658f8c151b22680cf594d028e180a8a859fc9b8 (diff) | |
| download | gitlab-ce-18bd1c9d30e16783d750c7786cbcc7d350f4d0aa.tar.gz | |
update all teams code. refactoring and some corrections
Diffstat (limited to 'app/controllers/application_controller.rb')
| -rw-r--r-- | app/controllers/application_controller.rb | 9 |
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 |
