Change the logic so projects are only shown when you can access all resources

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2019-08-21 09:12:01 +02:00
parent c8d2c5ed33
commit 62a637fd42
No known key found for this signature in database
GPG key ID: 7076EA9751AACDDA

View file

@ -353,12 +353,15 @@ class Manager implements IManager {
return $access; return $access;
} }
$access = false; $access = null;
// Access is granted when a user can access all resources
foreach ($collection->getResources() as $resource) { foreach ($collection->getResources() as $resource) {
if ($resource->canAccess($user)) { if (!$resource->canAccess($user)) {
$access = true; $access = false;
break; break;
} }
$access = true;
} }
$this->cacheAccessForCollection($collection, $user, $access); $this->cacheAccessForCollection($collection, $user, $access);