mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
changes to TaskVoter reinstated, mistake made in conflict resolvement
This commit is contained in:
@@ -146,18 +146,15 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
||||
// do regular check.
|
||||
return $this->voter->voteOnAttribute($attribute, $subject, $token);
|
||||
|
||||
/*
|
||||
|
||||
if ($subject instanceof AbstractTask) {
|
||||
$associated = $subject->getPerson() ?? $subject->getCourse();
|
||||
if ($associated === null) {
|
||||
throw new \LogicException("You should associate a person with task "
|
||||
. "in order to check autorizations");
|
||||
}
|
||||
|
||||
$person = $subject->getPerson();
|
||||
} elseif ($subject instanceof Person) {
|
||||
$associated = $subject;
|
||||
} else {
|
||||
// subject is null. We check that at least one center is reachable
|
||||
$centers = $this->authorizationHelper->getReachableCenters($token->getUser(), new Role($attribute));
|
||||
|
||||
@@ -173,6 +170,8 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
||||
return false;
|
||||
} elseif ($associated instanceof AccompanyingPeriod && !$this->accessDecisionManager->decide($token, [AccompanyingPeriodVoter::SEE], $associated)) {
|
||||
return false;
|
||||
} elseif ($associated instanceof AccompanyingPeriod && !$this->accessDecisionManager->decide($token, [AccompanyingPeriodVoter::SEE], $associated)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->authorizationHelper->userHasAccess(
|
||||
@@ -180,7 +179,7 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
||||
$subject,
|
||||
$attribute
|
||||
);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
public function getRoles()
|
||||
|
Reference in New Issue
Block a user