debian-mirror-gitlab/app/policies/concerns/crud_policy_helpers.rb
2020-10-24 23:57:45 +05:30

29 lines
525 B
Ruby

# 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_update_admin(name),
:"destroy_#{name}"
]
end
def create_update_admin(name)
[
:"create_#{name}",
:"update_#{name}",
:"admin_#{name}"
]
end
end
end