lib/decidim/admin/engine.rb in decidim-admin-0.4.0 vs lib/decidim/admin/engine.rb in decidim-admin-0.4.1

- old
+ new

@@ -11,12 +11,10 @@ require "foundation-rails" require "foundation_rails_helper" require "autoprefixer-rails" require "rectify" -require_dependency File.join(__dir__, "..", "..", "..", "app/models/decidim/admin/abilities/admin_user") - module Decidim module Admin # Decidim's core Rails Engine. class Engine < ::Rails::Engine isolate_namespace Decidim::Admin @@ -31,13 +29,16 @@ app.config.assets.precompile += %w(decidim_admin_manifest.js) end initializer "decidim_admin.inject_abilities_to_user" do |_app| Decidim.configure do |config| - config.abilities += ["Decidim::Admin::Abilities::AdminUser"] - config.abilities += ["Decidim::Admin::Abilities::ParticipatoryProcessAdmin"] - config.abilities += ["Decidim::Admin::Abilities::CollaboratorUser"] + config.admin_abilities += [ + "Decidim::Admin::Abilities::AdminAbility", + "Decidim::Admin::Abilities::ParticipatoryProcessAdminAbility", + "Decidim::Admin::Abilities::ParticipatoryProcessCollaboratorAbility", + "Decidim::Admin::Abilities::ParticipatoryProcessModeratorAbility" + ] end end initializer "decidim_admin.menu" do Decidim.menu :admin_menu do |menu| @@ -55,10 +56,11 @@ menu.item I18n.t("menu.participatory_process_groups", scope: "decidim.admin"), decidim_admin.participatory_process_groups_path, icon_name: "layers", position: 3, - active: :inclusive + active: :inclusive, + if: can?(:read, Decidim::ParticipatoryProcessGroup) menu.item I18n.t("menu.static_pages", scope: "decidim.admin"), decidim_admin.static_pages_path, icon_name: "book", position: 4,