correct permissions on user pages
This commit is contained in:
parent
55d4de044d
commit
1d5722d745
2 changed files with 8 additions and 0 deletions
|
|
@ -67,6 +67,7 @@
|
|||
* Show a user and its details.
|
||||
*
|
||||
* @throws IdNotFoundException
|
||||
* @throws AccessDeniedException
|
||||
* @param string $userUrl URL-Username of an user
|
||||
*/
|
||||
public function user($userUrl)
|
||||
|
|
@ -74,6 +75,11 @@
|
|||
// Get user
|
||||
$user = $this->Users->getUserByUrl($userUrl);
|
||||
|
||||
// Check permissions
|
||||
if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) == 0 && $user['id'] != IntermediateController::$user['id']) {
|
||||
throw new \nre\exceptions\AccessDeniedException();
|
||||
}
|
||||
|
||||
// Get Characters
|
||||
$characters = $this->Characters->getCharactersForUser($user['id']);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue