Class: Decidim::DecidimAwesome::Admin::Permissions
- Inherits:
-
Decidim::DefaultPermissions
- Object
- Decidim::DefaultPermissions
- Decidim::DecidimAwesome::Admin::Permissions
- Includes:
- ConfigConstraintsHelpers
- Defined in:
- app/permissions/decidim/decidim_awesome/admin/permissions.rb
Constant Summary
Constants included from ConfigConstraintsHelpers
ConfigConstraintsHelpers::OTHER_MANIFESTS
Instance Method Summary collapse
Methods included from ConfigConstraintsHelpers
#check, #component_manifests, #components_list, #enabled_configs, #md5, #participatory_space_manifests, #participatory_spaces_list, #translate_constraint_value
Instance Method Details
#permissions ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/permissions/decidim/decidim_awesome/admin/permissions.rb', line 9 def return if .scope != :admin return unless user return if user.read_attribute("admin").blank? return unless .action == :edit_config if .subject == :admin_accountability && DecidimAwesome.admin_accountability.respond_to?(:include?) if global? toggle_allow(DecidimAwesome.admin_accountability.include?(:admin_roles)) else toggle_allow(DecidimAwesome.admin_accountability.include?(:participatory_space_roles)) end elsif .subject == :private_data && config_enabled?(:proposal_private_custom_fields) if private_data.present? allow! if private_data.destroyable? else allow! end else toggle_allow(config_enabled?(*.subject)) end end |