| @@ 78-86 (lines=9) @@ | ||
| 75 | * @param UserVO $user |
|
| 76 | * @throws MethodNotAllowedException |
|
| 77 | */ |
|
| 78 | protected function checkForRole(Route $route, UserVO $user) |
|
| 79 | { |
|
| 80 | if ($route->hasDefault('_role')) { |
|
| 81 | $role = $route->getDefault('_role'); |
|
| 82 | if (!in_array($role, $user->roles)) { |
|
| 83 | throw new MethodNotAllowedException([], sprintf('Need role %s', $role)); |
|
| 84 | } |
|
| 85 | } |
|
| 86 | } |
|
| 87 | ||
| 88 | /** |
|
| 89 | * @param int $userId |
|
| @@ 77-85 (lines=9) @@ | ||
| 74 | * @param UserVO $user |
|
| 75 | * @throws MethodNotAllowedException |
|
| 76 | */ |
|
| 77 | protected function checkForRole(Route $route, UserVO $user) |
|
| 78 | { |
|
| 79 | if ($route->hasDefault('_role')) { |
|
| 80 | $role = $route->getDefault('_role'); |
|
| 81 | if (!in_array($role, $user->roles)) { |
|
| 82 | throw new MethodNotAllowedException([], sprintf('Need role %s', $role)); |
|
| 83 | } |
|
| 84 | } |
|
| 85 | } |
|
| 86 | ||
| 87 | /** |
|
| 88 | * @param int $userId |
|