Add Groups resource type and scopes to authorization schema#5
Conversation
…ation implementation Closes #35562 Signed-off-by: vramik <vramik@redhat.com>
Codoki PR ReviewSummary: Simplify group filtering, remove unused delegator Issues (Critical & High only)
Showing top 1 issues. Critical: 1, High: 0. See inline suggestions for more. Key Feedback (click to expand)
Confidence: 2/5 — Not ready to merge (1 critical · status: Requires changes) React with 👍 or 👎 if you found this review useful. |
| return true; | ||
| } | ||
|
|
||
| return hasPermission(null, AdminPermissionsSchema.VIEW, AdminPermissionsSchema.MANAGE); |
There was a problem hiding this comment.
🛑 Critical: Granting manage via VIEW scope is over-permissive and allows manage operations (create/update groups) with only view permissions. Restrict to MANAGE scope to avoid privilege escalation and align intent.
| return hasPermission(null, AdminPermissionsSchema.VIEW, AdminPermissionsSchema.MANAGE); | |
| return hasPermission(null, AdminPermissionsSchema.MANAGE); |
| Set<String> granted = new HashSet<>(); | ||
|
|
||
| resourceStore.findByType(server, AdminPermissionsSchema.GROUPS_RESOURCE_TYPE, groupResource -> { | ||
| if (hasPermission(groupResource.getId(), AdminPermissionsSchema.VIEW_MEMBERS, AdminPermissionsSchema.MANAGE_MEMBERS)) { |
There was a problem hiding this comment.
🔷 Medium: Resource.getId() is the internal resource store ID, but hasPermission expects the resource name (group ID). This prevents correct per-group permission checks and causes full-realm searches instead of group-filtered queries. Use resource.getName() for both the check and the returned IDs.
No description provided.