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: 568cfe6399d46d0a9590666a255ea1dd09ec4159 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

module Organizations
  class ApplicationController < ::ApplicationController
    skip_before_action :authenticate_user!
    before_action :organization

    layout '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)
      return if Feature.enabled?(:ui_for_organizations, current_user) &&
        can?(current_user, action, organization)

      access_denied!
    end
  end
end