Skip to content

Commit 006d141

Browse files
authored
[Bug]: newly added permissions should be inherit instead of empty (#66)
* Update DynamicPermissionResource.php * Apply php-cs-fixer changes --------- Co-authored-by: kingjia90 <[email protected]>
1 parent 8b9e967 commit 006d141

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/CoreExtensions/ClassDefinitions/DynamicPermissionResource.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ protected function cleanupAndCheckForEmpty($data)
136136

137137
public function getDataForEditmode(mixed $data, DataObject\Concrete $object = null, array $params = []): mixed
138138
{
139+
$permissions = $this->getPermissionResources();
140+
foreach ($permissions as $permission) {
141+
if (!array_key_exists($permission['value'], $data)) {
142+
$data[$permission['value']] = Service::INHERIT;
143+
}
144+
}
145+
139146
return $data;
140147
}
141148

0 commit comments

Comments
 (0)