removed deprecated registry and use session

This commit is contained in:
Gabriel Baker 2013-06-04 20:17:17 +01:00
commit 757a82c26f
2 changed files with 2 additions and 6 deletions

View file

@ -86,10 +86,10 @@ class BuildController extends \PHPCI\Controller
*/
public function delete($buildId)
{
if (!Registry::getInstance()->get('user')->getIsAdmin()) {
if (empty($_SESSION['user']) || !$_SESSION['user']->getIsAdmin()) {
throw new \Exception('You do not have permission to do that.');
}
$build = $this->_buildStore->getById($buildId);
$this->_buildStore->delete($build);