| @@ 637-645 (lines=9) @@ | ||
| 634 | /** |
|
| 635 | * @param bool $admin |
|
| 636 | */ |
|
| 637 | public function setAdmin($admin) |
|
| 638 | { |
|
| 639 | if ($admin == true && !$this->isAdmin()) { |
|
| 640 | $this->addRole(static::ROLE_ADMIN); |
|
| 641 | } |
|
| 642 | elseif ($admin == false && $this->isAdmin()) { |
|
| 643 | $this->removeRole(static::ROLE_ADMIN); |
|
| 644 | } |
|
| 645 | } |
|
| 646 | ||
| 647 | /** |
|
| 648 | * Is current user an admin ? |
|
| @@ 660-668 (lines=9) @@ | ||
| 657 | /** |
|
| 658 | * @param bool $userAdmin |
|
| 659 | */ |
|
| 660 | public function setUserAdmin($userAdmin) |
|
| 661 | { |
|
| 662 | if ($userAdmin == true && !$this->isSuperAdmin()) { |
|
| 663 | $this->addRole(static::ROLE_SUPER_ADMIN); |
|
| 664 | } |
|
| 665 | elseif ($userAdmin == false && $this->isSuperAdmin()) { |
|
| 666 | $this->removeRole(static::ROLE_SUPER_ADMIN); |
|
| 667 | } |
|
| 668 | } |
|
| 669 | ||
| 670 | /** |
|
| 671 | * @Assert\Callback(groups={"Adding","Editing"}) |
|