2018-07-24 06:00:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-04-13 11:09:20 -04:00
|
|
|
module CrudPolicyHelpers
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
class_methods do
|
2018-04-05 12:42:57 -04:00
|
|
|
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
|