Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit f274294

Browse files
committed
Make sure to recompute readonly flag if current context has a permission mask, by using node.info.nocache hook.
1 parent 63d7e8a commit f274294

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/src/plugins/access.fs/FsAccessDriver.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
15491549
if ($dir == "" && $lsOptions["d"] && RecycleBinManager::recycleEnabled() && $this->getContextualOption($ctx, "HIDE_RECYCLE") !== true) {
15501550
$recycleBinOption = RecycleBinManager::getRelativeRecycle();
15511551
$recycleNode = $selection->nodeForPath("/".$recycleBinOption);
1552-
if (file_exists($recycleNode->getUrl())) {
1552+
if (file_exists($recycleNode->getUrl()) && $this->isReadable($recycleNode)) {
15531553
$recycleNode->loadNodeInfo();
15541554
$nodesList->addBranch($recycleNode);
15551555
}
@@ -1749,6 +1749,14 @@ public function localizeNodeInfo(&$ajxpNode, $parentNode = false, $details = fal
17491749
$ajxpNode->setLabel($messages[122]);
17501750
}
17511751

1752+
$user = $ajxpNode->getContext()->getUser();
1753+
if(!empty($user) && $user->getMergedRole()->hasMask($ajxpNode->getRepositoryId())){
1754+
$localMeta["ajxp_readonly"] = "false";
1755+
if (!@$this->isWriteable($ajxpNode)) {
1756+
$localMeta["ajxp_readonly"] = "true";
1757+
}
1758+
}
1759+
17521760
// Now remerge in node
17531761
if(count($localMeta)){
17541762
$ajxpNode->mergeMetadata($localMeta);

0 commit comments

Comments
 (0)