Skip to content

Confirm user#24

Merged
javihgil merged 15 commits into5.5from
confirm-user
Jun 30, 2025
Merged

Confirm user#24
javihgil merged 15 commits into5.5from
confirm-user

Conversation

@AritzPalaciosOrtiz
Copy link
Member

No description provided.

Copy link
Member

@javihgil javihgil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also you need to add the permission to config/security/admin_role_hierarchy.yaml, and buttons to templates :)


public function userConfirm(User $user, string $token): Response
{
if ($user->getConfirmationToken() === $token) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check permission: $this->denyAccessUnlessGranted('PERMISSION_SFS_USER_ADMIN_USERS_CONFIRM', $user);

Copy link
Member Author

@AritzPalaciosOrtiz AritzPalaciosOrtiz Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I check if the user has RolesAdminInterface or is it not necessary in this case?

ROLE_SFS_USER_ADMIN_ADMINISTRATORS_RW:
- ROLE_SFS_USER_ADMIN_ADMINISTRATORS_RO
- PERMISSION_SFS_USER_ADMIN_USERS_PROMOTE
- PERMISSION_SFS_USER_ADMIN_USERS_CONFIRM
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those roles should be inherited by ROLE_SFS_USER_ADMIN_USERS_RW


public function userConfirm(string $user): Response
{
$user = $this->userManager->findUserBy(['id' => $user]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For PHPStan insert /** @var User|ConfirmableInterface $user */

PERMISSION_SFS_USER_ADMIN_HISTORY_LIST:
- ROLE_ADMIN_ACCESS_HISTORY_LIST No newline at end of file
- ROLE_ADMIN_ACCESS_HISTORY_LIST
PERMISSION_SFS_USER_ADMIN_USERS_CONFIRM:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to support deprecated roles, those ones are new, so we don't need to add them as old format

'ROLE_ADMIN_INVITATIONS_LIST' => 'PERMISSION_SFS_USER_ADMIN_INVITATIONS_LIST',
'ROLE_ADMIN_INVITATIONS_DETAILS' => 'PERMISSION_SFS_USER_ADMIN_INVITATIONS_DETAILS',
'ROLE_ADMIN_ACCESS_HISTORY_LIST' => 'PERMISSION_SFS_USER_ADMIN_HISTORY_LIST',
'ROLE_ADMIN_USERS_CONFIRM' => 'PERMISSION_SFS_USER_ADMIN_USERS_CONFIRM',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to support deprecated roles, those ones are new, so we don't need to add them as old format

@javihgil javihgil merged commit 92ea3a9 into 5.5 Jun 30, 2025
4 checks passed
@javihgil javihgil deleted the confirm-user branch June 30, 2025 08:35
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.

2 participants