gitlab-org--gitlab-foss/app/policies/concerns/crud_policy_helpers.rb

24 lines
431 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module CrudPolicyHelpers
extend ActiveSupport::Concern
class_methods do
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