@@ -133,6 +133,7 @@ public function propFind(PropFind $propFind, INode $node): void {
133
133
134
134
ksort ($ rulesByPath );
135
135
$ inheritedPermissionsByMapping = [];
136
+ $ inheritedMaskByMapping = [];
136
137
$ mappings = [];
137
138
foreach ($ rulesByPath as $ rules ) {
138
139
foreach ($ rules as $ rule ) {
@@ -144,18 +145,22 @@ public function propFind(PropFind $propFind, INode $node): void {
144
145
if (!isset ($ inheritedPermissionsByMapping [$ mappingKey ])) {
145
146
$ inheritedPermissionsByMapping [$ mappingKey ] = Constants::PERMISSION_ALL ;
146
147
}
148
+ if (!isset ($ inheritedMaskByMapping [$ mappingKey ])) {
149
+ $ inheritedMaskByMapping [$ mappingKey ] = 0 ;
150
+ }
147
151
$ inheritedPermissionsByMapping [$ mappingKey ] = $ rule ->applyPermissions ($ inheritedPermissionsByMapping [$ mappingKey ]);
152
+ $ inheritedMaskByMapping [$ mappingKey ] |= $ rule ->getMask ();
148
153
}
149
154
}
150
155
151
- return array_map (function ($ mapping , $ permissions ) use ($ fileInfo ) {
156
+ return array_map (function ($ mapping , $ permissions, $ mask ) use ($ fileInfo ) {
152
157
return new Rule (
153
158
$ mapping ,
154
159
$ fileInfo ->getId (),
155
- Constants:: PERMISSION_ALL ,
160
+ $ mask ,
156
161
$ permissions
157
162
);
158
- }, $ mappings , $ inheritedPermissionsByMapping );
163
+ }, $ mappings , $ inheritedPermissionsByMapping, $ inheritedMaskByMapping );
159
164
});
160
165
161
166
$ propFind ->handle (self ::GROUP_FOLDER_ID , function () use ($ fileInfo ) {
0 commit comments