2016-06-29 11:21:21 +02:00
|
|
|
class AgeRangePolicy < ApplicationPolicy
|
2016-06-29 16:09:27 +02:00
|
|
|
%w(create update destroy show).each do |action|
|
2016-06-29 11:21:21 +02:00
|
|
|
define_method "#{action}?" do
|
2019-01-14 12:57:31 +01:00
|
|
|
user.admin?
|
2016-06-29 11:21:21 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|