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

application_controller.rb « organizations « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5f5a57d176bc6091cd940ae5068185f35e3112a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module Organizations
  class ApplicationController < ::ApplicationController
    before_action :organization

    private

    def organization
      return unless params[:organization_path]

      @organization = Organizations::Organization.find_by_path(params[:organization_path])
    end
    strong_memoize_attr :organization

    def authorize_action!(action)
      access_denied! if Feature.disabled?(:ui_for_organizations)
      access_denied! unless can?(current_user, action, organization)
    end
  end
end