10 lines
265 B
Ruby
10 lines
265 B
Ruby
class AdminOrAuthorPolicy < ApplicationPolicy
|
|
[:create?, :index?, :new?].each do |action|
|
|
define_method(action) { @user.internal_user? }
|
|
end
|
|
|
|
[:destroy?, :edit?, :show?, :update?].each do |action|
|
|
define_method(action) { admin? || author? }
|
|
end
|
|
end
|