Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: User Management in BE should respect user’s parent roles #5444

Open
1 task done
tomgloeckler opened this issue Jan 22, 2025 · 0 comments
Open
1 task done

BUG: User Management in BE should respect user’s parent roles #5444

tomgloeckler opened this issue Jan 22, 2025 · 0 comments
Labels

Comments

@tomgloeckler
Copy link

tomgloeckler commented Jan 22, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Create a role that inherits from Neos.Neos:Administrator, assign it to your admin user account and make Neos.Neos:Administrator abstract. Now edit your account in the User Management Module, e.g. change your password. When you try to save the changes you get this „Do not lock yourself out” warning and saving is not possible.

Image

Expected Behavior

Having a role that inherits from Neos.Neos:Administrator I expect to have all the parent role’s privileges when editing users/accounts in the backend.

Steps To Reproduce

(see above)

Environment

- Flow: 8.3.12
- Neos: 8.3.18
- PHP: 8.2

Anything else?

This is what a potential solution could look like – take all parent roles into account:

# Neos\Neos\Controller\Module\Administration\UsersController L. 372
foreach ($roleIdentifiers as $roleIdentifier) {
    $role = $this->policyService->getRole($roleIdentifier);
    $roles[$roleIdentifier] = $role;
    foreach($role->getAllParentRoles() as $parentRoleIdentifier => $parentRole) {
        if(!isset($roles[$parentRoleIdentifier])) {
            $roles[$parentRoleIdentifier] = $parentRole;
	} 
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant