Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[issue-2953] Fixed access to resources for non-admin Tag Managers (having a 'tag:management' permission) - #2432

Merged
chrisknoll merged 1 commit into
masterfrom
issue-2953
Mar 15, 2025
Merged

chrisknoll merged 1 commit into
masterfrom
issue-2953

Conversation

@oleg-odysseus

@oleg-odysseus oleg-odysseus commented Mar 12, 2025

Copy link
Copy Markdown
Contributor

@oleg-odysseus
oleg-odysseus requested a review from konstjar March 12, 2025 12:15
@chrisknoll

Copy link
Copy Markdown
Collaborator

I noticed there's a few places where this was changed:

checkOwnerOrAdminOrGranted(entity);

to:

checkPermissions(entity, ImmutableSet.of(PermissionCheckType.IS_OWNER, PermissionCheckType.IS_ADMIN, PermissionCheckType.HAS_WRITE_ACCESS));

On the surface, it seems it makes sense to have a shared function that does a permission check that is shared across different code contexts. The naming of it seems little odd since the name of the function describes something literal (checking owner, or admin, or granted) vs. something like checkModifyPermissions, where 'modify permissions' can change over time (like adding a new permission role).

Did you think it makes sense to use a shared function in those places where you removed 'checkOwnerOrAdminOrGranted' instead of duplicating the set? I think having a shared function can encapsulate the logic about what the collection of roles implies a certain permission vs. deriving the meaning from an arbitrary collection of permissions/roles.

@chrisknoll chrisknoll closed this Mar 12, 2025
@chrisknoll chrisknoll reopened this Mar 12, 2025
@oleg-odysseus

Copy link
Copy Markdown
Contributor Author

Hi Chris. I`ve removed the refactoring part from this and issue-2953-2.14 branch to retain only the bug fix.

@chrisknoll
chrisknoll merged commit 21947d3 into master Mar 15, 2025
@chrisknoll
chrisknoll deleted the issue-2953 branch March 15, 2025 17:53
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.

Tagging administration cannot be done without Admin role assigned

2 participants