summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-07-01 09:05:10 -0400
committerFrederic Guillot <fred@kanboard.net>2016-07-01 09:05:10 -0400
commit4b94714b3d45656b022228562478514024550732 (patch)
treec3f6d0ff938625187dd8faab0160e48391bd7069 /app
parent5a7afc67d2a684e1401920efa2c86ec6204bf667 (diff)
Fixed PHP error in UserHelper when having no user session
Diffstat (limited to 'app')
-rw-r--r--app/Helper/UserHelper.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/Helper/UserHelper.php b/app/Helper/UserHelper.php
index ae3efe1d..ab259a62 100644
--- a/app/Helper/UserHelper.php
+++ b/app/Helper/UserHelper.php
@@ -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;
}