mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add role to get acl on confidential periods
This commit is contained in:
parent
065b10b877
commit
ee14cd268b
@ -873,6 +873,12 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
AccompanyingPeriodVoter::EDIT,
|
||||
AccompanyingPeriodVoter::DELETE,
|
||||
],
|
||||
AccompanyingPeriodVoter::REASSIGN_BULK => [
|
||||
AccompanyingPeriodVoter::CONFIDENTIAL_CRUD,
|
||||
],
|
||||
AccompanyingPeriodVoter::TOGGLE_CONFIDENTIAL => [
|
||||
AccompanyingPeriodVoter::CONFIDENTIAL_CRUD,
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
@ -83,6 +83,11 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
|
||||
*/
|
||||
public const SEE_DETAILS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_DETAILS';
|
||||
|
||||
/**
|
||||
* Give the ability to see all confidential courses
|
||||
*/
|
||||
public const CONFIDENTIAL_CRUD = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CRUD_CONFIDENTIAL';
|
||||
|
||||
public const TOGGLE_CONFIDENTIAL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL';
|
||||
|
||||
/**
|
||||
@ -117,6 +122,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
|
||||
return [
|
||||
self::SEE,
|
||||
self::SEE_DETAILS,
|
||||
self::CONFIDENTIAL_CRUD,
|
||||
self::CREATE,
|
||||
self::EDIT,
|
||||
self::DELETE,
|
||||
@ -200,6 +206,10 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
|
||||
|
||||
// if confidential, only the referent can see it
|
||||
if ($subject->isConfidential()) {
|
||||
if ($this->voterHelper->voteOnAttribute(self::CONFIDENTIAL_CRUD, $subject, $token)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $token->getUser() === $subject->getUser();
|
||||
}
|
||||
}
|
||||
|
@ -302,6 +302,7 @@ CHILL_PERSON_STATS: Statistiques sur les personnes
|
||||
CHILL_PERSON_LISTS: Liste des personnes
|
||||
CHILL_PERSON_DUPLICATE: Gérer les doublons de personnes
|
||||
CHILL_PERSON_ACCOMPANYING_PERIOD_SEE: Vision simplifiée d'une période d'accompagnement
|
||||
CHILL_PERSON_ACCOMPANYING_PERIOD_CONFIDENTIAL: Voir et modifier les périodes d'accompagnement confidentielles
|
||||
CHILL_PERSON_ACCOMPANYING_PERIOD_DELETE: Supprimer une période d'accompagnement
|
||||
CHILL_PERSON_ACCOMPANYING_PERIOD_RE_OPEN: Ré-ouvrir un parcours clotûré
|
||||
CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL_ALL: Modifier la confidentialité de tous les parcours
|
||||
|
Loading…
x
Reference in New Issue
Block a user