Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/organizations/application_controller.rb')
-rw-r--r--app/controllers/organizations/application_controller.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/app/controllers/organizations/application_controller.rb b/app/controllers/organizations/application_controller.rb
index 568cfe6399d..d3c3e878bdf 100644
--- a/app/controllers/organizations/application_controller.rb
+++ b/app/controllers/organizations/application_controller.rb
@@ -2,7 +2,7 @@
module Organizations
class ApplicationController < ::ApplicationController
- skip_before_action :authenticate_user!
+ before_action :check_feature_flag!
before_action :organization
layout 'organization'
@@ -16,11 +16,16 @@ module Organizations
end
strong_memoize_attr :organization
- def authorize_action!(action)
- return if Feature.enabled?(:ui_for_organizations, current_user) &&
- can?(current_user, action, organization)
+ def check_feature_flag!
+ access_denied! unless Feature.enabled?(:ui_for_organizations, current_user)
+ end
+
+ def authorize_create_organization!
+ access_denied! unless can?(current_user, :create_organization)
+ end
- access_denied!
+ def authorize_read_organization!
+ access_denied! unless can?(current_user, :read_organization, organization)
end
end
end