|
class AdminAuthorization < ActiveAdmin::AuthorizationAdapter
|
|
|
|
def authorized?(action, subject = nil)
|
|
if subject.is_a?(EmailBatch) && :update == action
|
|
subject.can_run_batch?
|
|
elsif subject.is_a?(AffiliatePartner) && :destroy == action
|
|
false
|
|
else
|
|
true
|
|
end
|
|
end
|
|
|
|
end
|