adaptations for acl with tasks

This commit is contained in:
2021-10-26 18:05:06 +02:00
parent bae06fcc9c
commit 965ea528e3
22 changed files with 371 additions and 298 deletions

View File

@@ -16,10 +16,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
* AbstractTask
*
* @ORM\MappedSuperclass()
* @UserCircleConsistency(
* "CHILL_TASK_TASK_SHOW",
* getUserFunction="getAssignee"
* )
*/
abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
{
@@ -52,7 +48,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
* @ORM\Column(name="description", type="text")
*/
private $description = '';
/**
*
* @var User
@@ -61,7 +57,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
* )
*/
private $assignee;
/**
*
* @var Person
@@ -78,25 +74,25 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
*/
private $course;
/**
*
* @var Scope
* @ORM\ManyToOne(
* targetEntity="\Chill\MainBundle\Entity\Scope"
* )
* )
*/
private $circle;
/**
* @var boolean
* @ORM\Column(name="closed", type="boolean", options={ "default"=false })
*/
private $closed = false;
public function __construct()
{
}
/**
@@ -125,7 +121,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
/**
* Set currentStates
*
*
* The current states are sorted in a single array, non associative.
*
* @param $currentStates
@@ -141,8 +137,8 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
/**
* Get currentStates
*
* The states are returned as required by marking store format.
*
* The states are returned as required by marking store format.
*
* @return array
*/
@@ -198,7 +194,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
{
return $this->description;
}
public function getAssignee(): ?User
{
return $this->assignee;
@@ -218,7 +214,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
{
return $this->circle;
}
public function setAssignee(User $assignee = null)
{
$this->assignee = $assignee;
@@ -250,9 +246,9 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
} else {
return $this->getCourse()->getCenter();
}
return null;
}
public function getContext()
@@ -264,7 +260,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
// }
return $this->getPerson() ?? $this->getCourse();
}
public function getScope(): ?\Chill\MainBundle\Entity\Scope
{
return $this->getCircle();
@@ -277,9 +273,9 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
{
return $this->closed;
}
/**
*
*
* @param bool $closed
*/
public function setClosed(bool $closed)