Fixed PHP error in UserHelper when having no user session

This commit is contained in:
Frederic Guillot
2016-07-01 09:05:10 -04:00
parent 5a7afc67d2
commit 4b94714b3d
2 changed files with 23 additions and 0 deletions

View File

@@ -107,6 +107,10 @@ class UserHelper extends Base
*/
public function hasAccess($controller, $action)
{
if (! $this->userSession->isLogged()) {
return false;
}
$key = 'app_access:'.$controller.$action;
$result = $this->memoryCache->get($key);
@@ -128,6 +132,10 @@ class UserHelper extends Base
*/
public function hasProjectAccess($controller, $action, $project_id)
{
if (! $this->userSession->isLogged()) {
return false;
}
if ($this->userSession->isAdmin()) {
return true;
}