Class: Decidim::DecidimAwesome::Permissions
- Inherits:
-
Decidim::DefaultPermissions
- Object
- Decidim::DefaultPermissions
- Decidim::DecidimAwesome::Permissions
- Defined in:
- app/permissions/decidim/decidim_awesome/permissions.rb
Instance Method Summary collapse
Instance Method Details
#editor_image_action? ⇒ Boolean
16 17 18 19 20 21 22 23 24 25 |
# File 'app/permissions/decidim/decidim_awesome/permissions.rb', line 16 def editor_image_action? return false unless .subject == :editor_image config = context.fetch(:awesome_config, {}) return allow! if user.admin? return allow! if config[:allow_images_in_proposals] return allow! if config[:allow_images_in_editors] return allow! if config[:allow_videos_in_editors] end |
#permissions ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'app/permissions/decidim/decidim_awesome/permissions.rb', line 6 def return unless user return Decidim::DecidimAwesome::Admin::Permissions.new(user, , context). if .scope == :admin editor_image_action? end |