Skip to content
Snippets Groups Projects
Commit 6ff5f30c authored by Tim Steiner's avatar Tim Steiner
Browse files

Restrict the various admin pages to users in the root role.

parent 3e36e50d
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,15 @@
class Auth_UserAdminController extends App_Controller_Action
{
public function preDispatch()
{
$user = Auth_UserModel::findCurrentUser();
$roles = Auth_GroupModel::findByUser($user);
if (!in_array(1, $roles->getId())) {
throw new Exception('You must be logged in to view this page.');
}
}
public function indexAction()
{
$users = Auth_UserModel::findAll();
......
......@@ -2,6 +2,14 @@
class Requests_ApprovalBodyAdminController extends App_Controller_Action
{
public function preDispatch()
{
$user = Auth_UserModel::findCurrentUser();
$roles = Auth_GroupModel::findByUser($user);
if (!in_array(1, $roles->getId())) {
throw new Exception('You must be logged in to view this page.');
}
}
public function indexAction()
{
......
......@@ -2,6 +2,15 @@
class Requests_ApprovalChainManagerController extends App_Controller_Action
{
public function preDispatch()
{
$user = Auth_UserModel::findCurrentUser();
$roles = Auth_GroupModel::findByUser($user);
if (!in_array(1, $roles->getId())) {
throw new Exception('You must be logged in to view this page.');
}
}
public function indexAction()
{
$in = $this->getRequest()->getParams();
......
<?php
class Requests_RequestTypeAdminController extends App_Controller_Action {
class Requests_RequestTypeAdminController extends App_Controller_Action
{
public function preDispatch()
{
$user = Auth_UserModel::findCurrentUser();
$roles = Auth_GroupModel::findByUser($user);
if (!in_array(1, $roles->getId())) {
throw new Exception('You must be logged in to view this page.');
}
}
public function indexAction()
{
$requestTypes = Requests_RequestTypeModel::findAll();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment