mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
upgrade AuthorizationEvent to receive other class than tasks
This commit is contained in:
parent
ebc0961fa8
commit
f9221f9f90
@ -5,7 +5,6 @@
|
|||||||
namespace Chill\TaskBundle\Security\Authorization;
|
namespace Chill\TaskBundle\Security\Authorization;
|
||||||
|
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Component\EventDispatcher\Event;
|
||||||
use Chill\TaskBundle\Entity\AbstractTask;
|
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -16,9 +15,9 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
|||||||
class AuthorizationEvent extends Event
|
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';
|
const VOTE = 'chill_task.vote';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
AbstractTask $task,
|
$subject,
|
||||||
$attribute,
|
$attribute,
|
||||||
TokenInterface $token
|
TokenInterface $token
|
||||||
) {
|
) {
|
||||||
$this->task = $task;
|
$this->subject = $subject;
|
||||||
$this->attribute = $attribute;
|
$this->attribute = $attribute;
|
||||||
$this->token = $token;
|
$this->token = $token;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTask(): AbstractTask
|
public function getSubject()
|
||||||
{
|
{
|
||||||
return $this->task;
|
return $this->subject;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAttribute()
|
public function getAttribute()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user