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:
parent
dd02920aed
commit
b53283fcb7
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue