Commit f9221f9f authored by Julien Fastré's avatar Julien Fastré

upgrade AuthorizationEvent to receive other class than tasks

parent ebc0961f
......@@ -5,7 +5,6 @@
namespace Chill\TaskBundle\Security\Authorization;
use Symfony\Component\EventDispatcher\Event;
use Chill\TaskBundle\Entity\AbstractTask;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
/**
......@@ -16,9 +15,9 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
class AuthorizationEvent extends Event
{
/**
* @var AbstractTask
* @var Chill\TaskBundle\Entity\AbstractTask|\Chill\PersonBundle\Entity\Person|null
*/
protected $task;
protected $subject;
/**
*
......@@ -41,18 +40,18 @@ class AuthorizationEvent extends Event
const VOTE = 'chill_task.vote';
public function __construct(
AbstractTask $task,
$subject,
$attribute,
TokenInterface $token
) {
$this->task = $task;
$this->subject = $subject;
$this->attribute = $attribute;
$this->token = $token;
}
public function getTask(): AbstractTask
public function getSubject()
{
return $this->task;
return $this->subject;
}
public function getAttribute()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment