Class: Decidim::Budgets::Admin::Permissions
- Inherits:
-
DefaultPermissions
- Object
- DefaultPermissions
- Decidim::Budgets::Admin::Permissions
- Defined in:
- decidim-budgets/app/permissions/decidim/budgets/admin/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
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 |
# File 'decidim-budgets/app/permissions/decidim/budgets/admin/permissions.rb', line 7 def return if .scope != :admin case .subject when :budget case .action when :create, :read, :export allow! when :update toggle_allow(budget) when :delete, :publish, :unpublish toggle_allow(budget && budget.projects.empty?) end when :project, :projects case .action when :create, :import_proposals, :project_category .allow! when :update, :destroy .allow! if project.present? end when :order case .action when :remind .allow! end when :project_category, :project_scope, :project_selected .allow! end end |