Release 2.0.34 (#4281)

This commit is contained in:
Kevin Papst
2023-09-17 22:32:01 +02:00
committed by GitHub
parent a6b237936e
commit de419350b2
29 changed files with 383 additions and 482 deletions

View File

@@ -22,6 +22,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter;
final class UserVoter extends Voter
{
private const ALLOWED_ATTRIBUTES = [
'access_user',
'view',
'edit',
'roles',
@@ -62,10 +63,18 @@ final class UserVoter extends Voter
return false;
}
if (!($subject instanceof User)) {
return false;
}
if ($attribute === 'contract') {
return $this->permissionManager->hasRolePermission($user, 'contract_other_profile');
}
if ($attribute === 'access_user') {
return $user->canSeeUser($subject);
}
if ($attribute === 'view_team_member') {
if ($subject->getId() !== $user->getId()) {
return false;