Verified Commit 7e8d4a21 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

fix problem with group_offer policy

parent 1bba203a
......@@ -32,8 +32,11 @@ class ApplicationPolicy
end
def department_manager_offer?
department_manager? &&
(user.department.include?(record.department) || user.group_offers.include?(record))
department_manager? && department_manager_offer_related?
end
def department_manager_offer_related?
user.department.include?(record.department) || user.group_offers.include?(record)
end
def superadmin_or_department_manager_offer?
......
......@@ -96,7 +96,7 @@ table.table.table-striped
- if offer.period_end.blank?
= link_to "#{ offer.active? ? t('.deactivate') : t('.activate') }",
change_active_state_group_offer_path(offer), method: :put, remote: :true
= link_to_if(policy(GroupOffer).initiate_termination?, 'Beenden', initiate_termination_group_offer_path(offer)) { '' }
= link_to_if(policy(offer).initiate_termination?, 'Beenden', initiate_termination_group_offer_path(offer)) { '' }
nav.navbar.section-navigation
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment