8000 Allow setting the decision strategy for permissions · Issue #44008 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Allow setting the decision strategy for permissions #44008

Description

@pedroigor

Description

By design, permissions are set with the decision strategy UNANIMOUS, by default. Just like other decisions made for FGAP v2, we wanted to start with hard constraints on the key aspects of the feature, mainly those that are related to how permissions are enforced and evaluated.

Based on the community feedback, the UNANIMOUS decision forces users and administrators to use aggregate policies whenever they want a permission to be granted if any of the associated policies grant access.

We should consider allowing setting the decision strategy on permissions, such as AFFIRMATIVE, so that administrators can opt in for how the decision should be made when evaluating the policies associated with the permission.

Value Proposition

Improve UX on FGAP v2 by allowing administrators to choose how the policies associated with a permission should be evaluated.

Goals

Improve UX on FGAP v2 by allowing administrators to choose how the policies associated with a permission should be evaluated.

Non-Goals

N/A

Discussion

#40965 (comment)

Notes

The fix should be about:

  • Adding a Decision Strategy field to the Permission UI, similar to what we have for regular policies
  • The UNANIMOUS decision strategy should still be the default
  • Update the testsuite
  • Update documentation

Activity

  1. added
    kind/enhancement
    area/admin/fine-grained-permissions
    on Nov 6, 2025
  2. added
    priority/important
    on Nov 6, 2025
  3. NickT-78 commented on Feb 11, 2026

    @NickT-78

    Hi,
    I'm deploying KeyCloak with FGAPv2 in a production environment subject to ISO27001 and have some use-cases. @vramik sent me over here from #37133 to document as much as I can.

    To start, I think a good idea is to recall the basic need and understanding.
    Rights can be set as a matrix system:

    resource 1 resource 2 resource 3
    user 1 view/update view deny
    user 2 view create/manage
    user 3 view view

    Next, understanding the 3-states and their precedence:

    • DENY : unanimous, it's forbidden not matter how many ALLOWs you have should they be direct or via hierarchy
    • ALLOW : if not specifically denied, access is granted
    • Not Set :
      • if there's an ALLOW through hierarchy, then allowed
      • otherwise, denied

    From there we need to define policies and permissions.
    My logic made me write the policies horizontally, such as:

    • allow_user1
    • deny_user1
    • allow_user2
    • allow_user3

    And the permissions vertically, such as:

    • perm_res1.view : allow_user1, allow_user2, allow_user3
    • perm_res1.update : allow_user1
    • perm_res2.view : allow_user1
    • perm_res3.view : deny_user1, allow_user3
    • perm_res3.create_update : allow_user2

    Since permissions are unanimous, all policies are joined with a logic AND, nothing works as expected.
    If we look at the policies vertically, we get this:

    • allow_res1.view : user1 or user2 or user3
    • allow_res1.update : user1
    • allow_res2.view : user1
    • deny_res3.all : user1
    • allow_res3.manage : user2
    • allow_res3.view : user3

    This solves most of the issues, though sometimes fairly verbose.
    Adding decision logic could enhance permission management but MUST respect the 3-state precedence, if a user gets an explicit DENY then it overcomes any other ALLOW for the user.

    I think that before going too deep into the policy/permission logic, we need to solve scope/role collisions. <-- let me know how I can report this

  4. NickT-78 commented on May 26, 2026

    @NickT-78

    New point on the clients.

    Users in supervisors group cannot edit Clients

    • group role mapping:
      • query-clients
      • query-users
      • view-events
      • create-client
      • vien-clients
      • query-groups
    • policy selects group as ALLOW
    • permission allowed for policy
      • all clients : mange, map-roles-client-scope, map-roles, view, map-roles-composite

    Users can update client information (description, urls, ...) but cannot modify anything in advanced tab.

    Can change some settings
    Image

    ... but not others
    Image

    While realm administrator can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/admin/fine-grained-permissionskind/enhancementpriority/importantstatus/triageteam/core-iam

    Fields

    Value

    None yet

    Effort

    None yet

    Votes

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0