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

class_methods.rb « project_policy « policies « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 42d993406a978c27bb0a1da736062f96b222a7c6 (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

class ProjectPolicy
  module ClassMethods
    def create_read_update_admin_destroy(name)
      [
        :"read_#{name}",
        *create_update_admin_destroy(name)
      ]
    end

    def create_update_admin_destroy(name)
      [
        :"create_#{name}",
        :"update_#{name}",
        :"admin_#{name}",
        :"destroy_#{name}"
      ]
    end
  end
end