File tree Expand file tree Collapse file tree
lib/Service/Policy/Runtime Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ private function resolveCore(
119119 ->setEffectiveValue ($ currentValue )
120120 ->setSourceScope ($ currentSourceScope )
121121 ->setVisible ($ visible )
122- ->setEditableByCurrentActor ($ visible && $ canOverrideBelow )
122+ ->setEditableByCurrentActor ($ visible && $ this -> canManagePolicyAtCurrentScope ( $ context ) )
123123 ->setCanSaveAsUserDefault ($ visible && $ canOverrideBelow )
124124 ->setCanUseAsRequestOverride ($ visible && $ canOverrideBelow )
125125 ->setBlockedBy ($ currentBlockedBy );
@@ -258,6 +258,13 @@ private function canApplyLowerLayer(
258258 return true ;
259259 }
260260
261+ private function canManagePolicyAtCurrentScope (PolicyContext $ context ): bool {
262+ $ actorCapabilities = $ context ->getActorCapabilities ();
263+
264+ return ($ actorCapabilities ['canManageSystemPolicies ' ] ?? false ) === true
265+ || ($ actorCapabilities ['canManageGroupPolicies ' ] ?? false ) === true ;
266+ }
267+
261268 /** @param list<mixed> $currentAllowedValues
262269 * @param list<mixed> $layerAllowedValues
263270 * @return list<mixed>
You can’t perform that action at this time.
0 commit comments