Class: Decidim::Budgets::Permissions
- Inherits:
-
DefaultPermissions
- Object
- DefaultPermissions
- Decidim::Budgets::Permissions
- Defined in:
- decidim-budgets/app/permissions/decidim/budgets/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 |
# File 'decidim-budgets/app/permissions/decidim/budgets/permissions.rb', line 6 def return unless user # Delegate the admin permission checks to the admin permissions class return Decidim::Budgets::Admin::Permissions.new(user, , context). if .scope == :admin return if .scope != :public return unless [:project, :order].include? .subject if .subject == :project case .action when :vote can_vote?(false) if can_vote_project?(project || order&.projects&.first) when :report .allow! end end can_vote?(true) if .action == :create && .subject == :order end |