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.12.0.pre app/permissions/decidim/user_manager_permissions.rb