Files
astuto/app/policies/tenant_setting_policy.rb
Riccardo Graziosi b2e9031ed6 Add some header settings (#199)
* Add show_roadmap_in_header setting
* Add collapse_boards_in_header setting (thanks @josh-bitovi)
2023-02-11 11:35:27 +01:00

20 lines
401 B
Ruby

class TenantSettingPolicy < ApplicationPolicy
def permitted_attributes_for_update
if user.admin?
[
:brand_display,
:root_board_id,
:show_vote_count,
:show_vote_button_in_board,
:show_roadmap_in_header,
:collapse_boards_in_header
]
else
[]
end
end
def update?
user.admin? and user.tenant_id == record.id
end
end