Class: Decidim::Meetings::Permissions
- Inherits:
-
DefaultPermissions
- Object
- DefaultPermissions
- Decidim::Meetings::Permissions
- Defined in:
- decidim-meetings/app/permissions/decidim/meetings/permissions.rb
Instance Method Summary collapse
Methods inherited from DefaultPermissions
Constructor Details
This class inherits a constructor from Decidim::DefaultPermissions
Instance Method Details
#permissions ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'decidim-meetings/app/permissions/decidim/meetings/permissions.rb', line 6 def return unless user # Delegate the admin permission checks to the admin permissions class return Decidim::Meetings::Admin::Permissions.new(user, , context). if .scope == :admin return if .scope != :public case .subject when :answer case .action when :create toggle_allow(can_answer_question?) end when :question case .action when :update toggle_allow(can_update_question?) end when :meeting case .action when :join toggle_allow(can_join_meeting?) when :leave toggle_allow(can_leave_meeting?) when :decline_invitation toggle_allow(can_decline_invitation?) when :create toggle_allow(can_create_meetings?) when :update toggle_allow(can_update_meeting?) when :withdraw toggle_allow(can_withdraw_meeting?) when :close toggle_allow(can_close_meeting?) when :register toggle_allow(can_register_invitation_meeting?) end else return end end |