Repository navigation
Closed
Milestone
Description
Why?
Apps want to grant resource-scoped roles to groups, not only to individual users. Example: in elixir-cloud-aai/cloud-registry, a service could be owned by a team that a node maintains as a group in Perun / LS Login (released in eduperson_entitlement), so that team changes are handled centrally instead of per resource.
FOCA's resource role model (resource_role_model.conf, g2 = _, _, _) could express this (g2, group:<entitlement>, owner, /services/X), and is_permitted() already checks each group-derived subject. Two things prevent it today:
- Unmapped groups are dropped when
group_mappingis set (get_current_groups()infoca/security/access_control/enforcement.py). Apps that map an admin group (as cloud-registry does) lose all other group claim values, so they cannot be subjects of rules unless every group is listed in the mapping, which is deployment configuration. - The resource role helpers only handle users.
add_resource_role(),remove_resource_role()andlist_resource_roles()always addsubject_prefix(user:), so rules forgroup:<value>subjects cannot be created, removed or listed through them.
How?
- Add an option (e.g.,
access_control.keep_unmapped_groups, defaultFalsefor compatibility) that keeps claim values without a mapping asgroup:<value>subjects alongside the mapped roles. - Let the resource role helpers handle group subjects, e.g., via a
subject_typeargument (userorgroup, defaultuser), and return the subject type when listing. - Expose the raw group claim values of the current request (e.g.,
get_current_groups(mapped=False)or a new helper), so that apps can enforce rules such as "users may only grant roles to groups they are a member of". - Document the pattern (resource ownership by groups), including the security considerations: who may grant roles to which groups is app policy.
Acceptance criteria
- With the option enabled, a role granted to
group:<value>on a resource applies to every user whose group claim contains<value>, also whengroup_mappingis set. - With the default, behavior is unchanged.
- Group subjects can be granted, revoked and listed via the helpers; user and group subjects cannot collide.
- Tests and documentation.
Target: v0.15.0. Related: elixir-cloud-aai/cloud-registry#101 (invitations), the first user of resource-scoped roles.
Metadata
Metadata
Assignees
Labels
No labels
Activity
uniqueg commentedon Oct 20, 2026
Implemented in #319 (merged into
dev): an optionkeep_group_subjectskeeps all group values as subjects, and the resource-role helpers accept group subjects (subject_type="group"). Roles that look like subjects cannot be granted; legacy rules of that kind are logged as warnings on the first policy load. Will be released with v0.15.0.