Skip to content

Fature/add new roles restriction for user actions - #84

Closed
sergio-soria-bi wants to merge 2 commits into
masterfrom
fature/Add-new-ROLES-restriction-for-User-Actions
Closed

Fature/add new roles restriction for user actions#84
sergio-soria-bi wants to merge 2 commits into
masterfrom
fature/Add-new-ROLES-restriction-for-User-Actions

Conversation

@sergio-soria-bi

Copy link
Copy Markdown
Contributor

No description provided.

@sonarqubecloud

Copy link
Copy Markdown

@sergio-soria-bi
sergio-soria-bi marked this pull request as draft August 31, 2026 14:38
);

var customUserGroupsMatch = params.getUserGroups().stream().anyMatch(group ->
restrictions.getGroups().getWhitelistedRoles().stream().anyMatch(group::equals)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If case we decide to keep the validation here, the matching function should be endsWith, since we're matching group suffixes, not entire group values.

restrictions.getGroups().getWhitelistedRoles().stream().anyMatch(group::equals)
);

return defaultUserGroupsMatch || customUserGroupsMatch;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct expression isn't defaultUserGroupsMatch || customUserGroupsMatch. With this, one user with role wrongprefix-USER could provision if there exists a USER whitelisted suffix and the component provisioner configuration doesn't define wrongprefix as a valid prefix.
The user group needs to match at least one of the prefixes configured, and macth at least one of the suffixes configured, or one of the whitelisted item suffixes.
matchAtLeastOneConfiguredPrefix && (matchAtLeastOneConfiguredSuffix || matchAtLeastOneWhitelistedSuffix)

@sergio-soria-bi

Copy link
Copy Markdown
Contributor Author

A new approach is agreed, so this PR is not required anymore.

@sergio-soria-bi
sergio-soria-bi deleted the fature/Add-new-ROLES-restriction-for-User-Actions branch September 1, 2026 07:56
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.

2 participants