Fixed PHP error in UserHelper when having no user session
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user