few fixed for Character permissions
This commit is contained in:
parent
b471efc970
commit
437353ca81
7 changed files with 17 additions and 9 deletions
|
|
@ -158,6 +158,16 @@
|
|||
// Get seminary
|
||||
$seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl);
|
||||
|
||||
// Check for already existing Character
|
||||
try {
|
||||
$this->Characters->getCharacterForUserAndSeminary($this->Auth->getUserId(), $seminary['id']);
|
||||
throw new \nre\exceptions\AccessDeniedException();
|
||||
}
|
||||
catch(\nre\exceptions\IdNotFoundException $e) {
|
||||
// The should be the case
|
||||
}
|
||||
|
||||
|
||||
// Character types
|
||||
$types = $this->Charactertypes->getCharacterTypesForSeminary($seminary['id']);
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
// Set userdata
|
||||
$this->set('loggedUser', IntermediateController::$user);
|
||||
$this->set('loggedCharacter', SeminaryRoleController::$character);
|
||||
$this->set('loggedSeminary', SeminaryRoleController::$seminary);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
*/
|
||||
class SeminarymenuController extends \hhu\z\Controller
|
||||
class SeminarymenuController extends \hhu\z\controllers\SeminaryRoleController
|
||||
{
|
||||
|
||||
|
||||
|
|
@ -35,8 +35,8 @@
|
|||
parent::preFilter($request, $response);
|
||||
|
||||
// Set userdata
|
||||
$this->set('loggedUser', IntermediateController::$user);
|
||||
$this->set('loggedSeminary', SeminaryRoleController::$seminary);
|
||||
$this->set('loggedUser', self::$user);
|
||||
$this->set('loggedSeminary', self::$seminary);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue