Its been a while
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
class Baclight::BrokerPolicy < ApplicationPolicy
|
||||
|
||||
def employers_list?; true; end
|
||||
|
||||
private
|
||||
|
||||
def broker_rule?
|
||||
user.admin? ||
|
||||
(user.broker? && record.broker_id == user.keychain[:id]) ||
|
||||
(user.carrier? && record.carrier_id == user.keychain[:id])
|
||||
end
|
||||
|
||||
end
|
||||
@@ -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
|
||||
@@ -0,0 +1,22 @@
|
||||
class Baclight::MemberPolicy < ApplicationPolicy
|
||||
|
||||
def initialize_dashboard?; member_rule?; end
|
||||
def id_card?; member_rule?; end
|
||||
|
||||
def claims?
|
||||
user.admin? ||
|
||||
(user.member? && record.id == user.keychain[:id]) ||
|
||||
(user.carrier? && record.carrier_id == user.keychain[:id])
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def member_rule?
|
||||
user.admin? ||
|
||||
(user.member? && record.id == user.keychain[:id]) ||
|
||||
(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