Sha256: b8d735eb2bf18bbdd2745de8959e09625087603dfa1a72f299f26ebeb53bd936

Contents?: true

Size: 562 Bytes

Versions: 21

Compression:

Stored size: 562 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class UserManagerPermissions < DefaultPermissions
    def permissions
      allow! if read_admin_dashboard_action?
      allow! if impersonate_managed_user_action?

      permission_action
    end

    private

    def read_admin_dashboard_action?
      permission_action.subject == :admin_dashboard &&
        permission_action.action == :read
    end

    def impersonate_managed_user_action?
      permission_action.subject == :managed_user &&
        permission_action.action == :impersonate
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
decidim-core-0.18.1 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.17.2 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.18.0 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.17.1 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.16.1 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.17.0 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.16.0 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.15.2 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.15.1 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.15.0 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.14.4 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.14.3 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.14.2 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.14.1 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.13.1 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.12.2 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.13.0 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.12.1 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.13.0.pre1 app/permissions/decidim/user_manager_permissions.rb
decidim-core-0.12.0 app/permissions/decidim/user_manager_permissions.rb