Skip to content

Let resolvers restrict what a grant confers on expanded targets - #27381

Open
dennisoelkers wants to merge 3 commits into
masterfrom
fix/team-users-grant-privilege-escalation
Open

dennisoelkers wants to merge 3 commits into
masterfrom
fix/team-users-grant-privilege-escalation

Conversation

@dennisoelkers

@dennisoelkers dennisoelkers commented Sep 14, 2026

Copy link
Copy Markdown
Member

Description

Motivation and Context

DefaultPermissionAndRoleResolver#resolveTargets lets subclasses expand a grant target into several targets. The enterprise resolver uses this to expand a collection into its entities and a team's users into the member users themselves. Until now the grant's capability was applied unchanged to every expanded target, so a capability on a container silently became the same capability on each of its members.

Extracts the capability lookup into an overridable permissionsFor(grant, target), plus a permissionsFor(capability, target) helper subclasses can delegate to when they need to narrow the capability for a target.

/prd Graylog2/graylog-plugin-enterprise#15607
/nocl No user-facing change.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

dennisoelkers and others added 3 commits September 14, 2026 10:06
DefaultPermissionAndRoleResolver#resolveTargets lets subclasses expand a
grant target into several targets. The enterprise resolver uses this to
expand a collection into its entities and a team's users into the member
users themselves. Until now the grant's capability was applied unchanged
to every expanded target, so a capability on a container silently became
the same capability on each of its members.

Extracts the capability lookup into an overridable permissionsFor(grant,
target), plus a permissionsFor(capability, target) helper subclasses can
delegate to when they need to narrow the capability for a target.

No behaviour change on its own. It is the hook used by the enterprise
fix for team membership conferring users:edit and users:rolesedit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant