Its been a while
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
class Baclight::EmployerPolicy < ApplicationPolicy
|
||||
|
||||
def id_cards?; employer_rule?; end
|
||||
def members_list?; true; end
|
||||
|
||||
private
|
||||
|
||||
def employer_rule?
|
||||
user.admin? ||
|
||||
(user.employer? && record.employer_id == user.keychain[:id]) ||
|
||||
(user.broker? && record.broker_id == user.keychain[:id]) ||
|
||||
(user.carrier? && record.carrier_id == user.keychain[:id])
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user