neos / neos/flow-development-collection
Check for parent roles
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 143
- Forks
- 191
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 9
Description
Description
If I assign a more specific role to a user and do a check for the base role, I would expect the PolicyService or the Account class to respect the inheritance of roles in Policy.yaml
Steps to Reproduce
- Create a Policy.yaml with two inherrited roles, e.g. Base and Specific (parentRoles: - Base).
- Assign the Specific role to an account.
- Check if the account has the Base role, e.g.
$account->hasRole('Base')
Expected behavior
I would expect to get a positive result, as the account has the Base role as inherited role.
Actual behavior
The result of the check is false.
If this is the intended behaviour, what would be the correct way to do a check with respecting the inheritance of roles?
Kind regards,
Christopher
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the PolicyService or Account entry point used by $account->hasRole('Base'), then inspect how Policy.yaml represents parentRoles. Reproduce the Base/Specific example and confirm that checking the inherited Base role returns a positive result, or document the correct check if inheritance is intentionally unsupported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authorization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100