#26219·abp

User permission management view does not include client-level (C) grants, while grantedPolicies does

Author: Keay5Created Oct 1, 2026Updated Oct 1, 2026
Labelsbug

Is there an existing issue for this?

  • I have searched the existing issues

Description

For the same user, two ABP APIs report different effective permissions:

  • GET /api/abp/application-configuration → auth.grantedPolicies includes permissions granted to the client (providerName = "C").
  • GET /api/permission-management/permissions?providerName=U&providerKey={userId} → the same permission is not granted in the user view and has no grantedProviders entry — although role-derived grants (providerName = "R") do appear there.

So when a user effectively has a permission because it was granted at the client level, the permission-management UI cannot show where it comes from. This is confusing for admins auditing "what can this user do" and for developers debugging authorization.

Reproduction Steps

  1. Grant a permission to a client (OpenIddict → Applications → {ClientId} → Permissions), or via API:

    http
    PUT /api/permission-management/permissions?providerName=C&providerKey={ClientId}
    { "permissions": [ { "name": "AbpIdentity.Users", "isGranted": true } ] }
  2. Sign in as a user with no roles and no user-level grants. The token is issued to the same client, so it carries the client_id claim.

  3. GET /api/abp/application-configuration → auth.grantedPolicies contains "AbpIdentity.Users": true.

  4. GET /api/permission-management/permissions?providerName=U&providerKey={userId} → AbpIdentity.Users has isGranted: false and an empty grantedProviders.

For comparison: when the same permission is granted to one of the user's roles, step 4 reports isGranted: true with an R entry in grantedProviders.

Expected behavior

Either:

  • the permission-management view for a user also lists client-level grants (as grantedProviders entries with providerName = "C"), so the admin UI explains the effective permissions consistently; or
  • if the current behavior is intended, the documentation states explicitly that client-level grants also apply to regular user tokens (and therefore to every user of that client).

Actual behavior

Role-derived grants are merged into the user view (RolePermissionManagementProvider has an explicit branch for providerName == "U"), but client-derived grants are not. The two APIs disagree without any documentation of this asymmetry.

Regression?

Unknown / probably not a regression. I did not find a recent change to the involved providers; the behavior looks long-standing.

Known Workarounds

Do not grant permissions to clients unless the intent is that every user of that client gets them. When auditing effective permissions, check both the user view and the client view.

Version

10.4.0 (also verified against the current dev source)

User Interface

Common (Default)

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

Source reading:

  • Management side: PermissionManager.GetInternalAsync loops over the registered IPermissionManagementProviders. The base PermissionManagementProvider.CheckAsync returns an empty result when providerName != Name. The only special case is RolePermissionManagementProvider, which — when asked about a user (providerName == "U" and the key parses as a user id) — also loads that user's roles and merges their grants. There is no equivalent branch for client grants.
  • Runtime side: PermissionChecker.IsGrantedAsync(name) iterates AbpPermissionOptions.ValueProviders (U, R, C) and returns true if any provider grants. ClientPermissionValueProvider reads AbpClaimTypes.ClientId from the current principal — which is present on regular user tokens too, not only on client_credentials tokens.
  • The docs for ClientPermissionValueProvider only say it is "especially useful on a machine to machine interaction where there is no current user", which does not make the user-token behavior explicit.

Questions:

  1. Is it intended that a permission granted to a client applies to every user signing in through that client?
  2. If yes, should the user view include C entries in grantedProviders? If the role merge is intentionally the limit, could this asymmetry please be documented?