debian-mirror-gitlab/app/policies/project_policy/class_methods.rb

20 lines
365 B
Ruby
Raw Normal View History

2018-05-09 12:01:36 +05:30
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