Production Build Working
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
class Baclight::BrokerPolicy < ApplicationPolicy
|
||||
|
||||
def employers_list?; true; end
|
||||
def employers_list?; broker_rule?; end
|
||||
|
||||
private
|
||||
|
||||
def broker_rule?
|
||||
user.admin? ||
|
||||
(user.broker? && record.broker_id == user.keychain[:id]) ||
|
||||
(user.broker? && record.id == user.keychain[:id]) ||
|
||||
(user.carrier? && record.carrier_id == user.keychain[:id])
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
class Baclight::CarrierPolicy < ApplicationPolicy
|
||||
|
||||
def employers_list?; carrier_rule?; end
|
||||
|
||||
private
|
||||
|
||||
def carrier_rule?
|
||||
user.admin? ||
|
||||
(user.carrier? && record.id == user.keychain[:id])
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,13 +1,24 @@
|
||||
class Baclight::EmployerPolicy < ApplicationPolicy
|
||||
|
||||
def id_cards?; employer_rule?; end
|
||||
def members_list?; true; end
|
||||
def members_list?; employer_rule?; end
|
||||
def coverage?; employer_rule?; end
|
||||
def available_document_categories?; member_employer_rule?; end
|
||||
def documents?; member_employer_rule?; end
|
||||
|
||||
private
|
||||
|
||||
def member_employer_rule?
|
||||
user.admin? ||
|
||||
(user.member? && record.id == user.keychain[:employer_id]) ||
|
||||
(user.employer? && record.id == user.keychain[:id]) ||
|
||||
(user.broker? && record.broker_id == user.keychain[:id]) ||
|
||||
(user.carrier? && record.carrier_id == user.keychain[:id])
|
||||
end
|
||||
|
||||
def employer_rule?
|
||||
user.admin? ||
|
||||
(user.employer? && record.employer_id == user.keychain[:id]) ||
|
||||
(user.employer? && record.id == user.keychain[:id]) ||
|
||||
(user.broker? && record.broker_id == user.keychain[:id]) ||
|
||||
(user.carrier? && record.carrier_id == user.keychain[:id])
|
||||
end
|
||||
|
||||
@@ -2,6 +2,7 @@ class Baclight::MemberPolicy < ApplicationPolicy
|
||||
|
||||
def initialize_dashboard?; member_rule?; end
|
||||
def id_card?; member_rule?; end
|
||||
def plan_benefits?; member_rule?; end
|
||||
|
||||
def claims?
|
||||
user.admin? ||
|
||||
@@ -12,7 +13,7 @@ class Baclight::MemberPolicy < ApplicationPolicy
|
||||
private
|
||||
|
||||
def member_rule?
|
||||
user.admin? ||
|
||||
user.admin? || user.provider? ||
|
||||
(user.member? && record.id == user.keychain[:id]) ||
|
||||
(user.employer? && record.employer_id == user.keychain[:id]) ||
|
||||
(user.broker? && record.broker_id == user.keychain[:id]) ||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
class Baclight::ProviderPolicy < ApplicationPolicy
|
||||
|
||||
def claims?; provider_rule?; end
|
||||
|
||||
private
|
||||
|
||||
def provider_rule?
|
||||
user.admin? || user.provider?
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user