gitlab-org--gitlab-foss/app/policies/project_policy/class_methods.rb
Bob Van Landuyt 6114c40fca Move ProjectPolicy-class methods into module
That way the ProjectPolicy class can be extended with this module
before we prepend the EE::ProjectPolicy. This makes the classmethods
available for rules defined in the EE::ProjectPolicy.
2018-04-10 19:43:01 +02:00

19 lines
365 B
Ruby

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