Skip to content

Commit 7d82233

Browse files
committed
fix: return the correct ACL mask for inherited acls
Signed-off-by: Robin Appelman <[email protected]>
1 parent 5c55ce0 commit 7d82233

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/DAV/ACLPlugin.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public function propFind(PropFind $propFind, INode $node): void {
133133

134134
ksort($rulesByPath);
135135
$inheritedPermissionsByMapping = [];
136+
$inheritedMaskByMapping = [];
136137
$mappings = [];
137138
foreach ($rulesByPath as $rules) {
138139
foreach ($rules as $rule) {
@@ -144,18 +145,22 @@ public function propFind(PropFind $propFind, INode $node): void {
144145
if (!isset($inheritedPermissionsByMapping[$mappingKey])) {
145146
$inheritedPermissionsByMapping[$mappingKey] = Constants::PERMISSION_ALL;
146147
}
148+
if (!isset($inheritedMaskByMapping[$mappingKey])) {
149+
$inheritedMaskByMapping[$mappingKey] = 0;
150+
}
147151
$inheritedPermissionsByMapping[$mappingKey] = $rule->applyPermissions($inheritedPermissionsByMapping[$mappingKey]);
152+
$inheritedMaskByMapping[$mappingKey] |= $rule->getMask();
148153
}
149154
}
150155

151-
return array_map(function ($mapping, $permissions) use ($fileInfo) {
156+
return array_map(function ($mapping, $permissions, $mask) use ($fileInfo) {
152157
return new Rule(
153158
$mapping,
154159
$fileInfo->getId(),
155-
Constants::PERMISSION_ALL,
160+
$mask,
156161
$permissions
157162
);
158-
}, $mappings, $inheritedPermissionsByMapping);
163+
}, $mappings, $inheritedPermissionsByMapping, $inheritedMaskByMapping);
159164
});
160165

161166
$propFind->handle(self::GROUP_FOLDER_ID, function () use ($fileInfo) {

0 commit comments

Comments
 (0)