Class: Decidim::Admin::Permissions
- Inherits:
-
DefaultPermissions
- Object
- DefaultPermissions
- Decidim::Admin::Permissions
- Defined in:
- decidim-admin/app/permissions/decidim/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
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'decidim-admin/app/permissions/decidim/admin/permissions.rb', line 6 def return if managed_user_action? unless .scope == :admin read_admin_dashboard_action? return end unless user disallow! return end if user_manager? begin allow! if .allowed? rescue Decidim::PermissionAction::PermissionNotSetError nil end end allow! if user_can_enter_space_area?(require_admin_terms_accepted: true) read_admin_dashboard_action? if user.admin? && admin_terms_accepted? allow! if read_admin_log_action? allow! if read_user_statistics_action? allow! if read_metrics_action? allow! if static_page_action? allow! if templates_action? allow! if organization_action? allow! if user_action? allow! if admin_user_action? allow! if .subject == :category allow! if .subject == :component allow! if .subject == :attachment allow! if .subject == :editor_image allow! if .subject == :attachment_collection allow! if .subject == :scope allow! if .subject == :scope_type allow! if .subject == :area allow! if .subject == :area_type allow! if .subject == :user_group allow! if .subject == :officialization allow! if .subject == :moderate_users allow! if .subject == :authorization allow! if .subject == :authorization_workflow allow! if .subject == :static_page_topic allow! if .subject == :help_sections allow! if .subject == :share_token allow! if .subject == :reminder if .subject == :taxonomy .action == :destroy ? allow_destroy_taxonomy? : allow! end if .action.in? [:manage_trash, :restore, :soft_delete] if .action == :soft_delete toggle_allow(trashable_deleted_resource.respond_to?(:deleted?) && !trashable_deleted_resource.deleted?) elsif .action == :restore toggle_allow(trashable_deleted_resource&.deleted?) else allow! end end allow! if .subject == :taxonomy_item end end |