Skip to content

Commit

Permalink
[Bug]: newly added permissions should be inherit instead of empty (#66)
Browse files Browse the repository at this point in the history
* Update DynamicPermissionResource.php

* Apply php-cs-fixer changes

---------

Co-authored-by: kingjia90 <kingjia90@users.noreply.github.com>
  • Loading branch information
kingjia90 and kingjia90 authored Aug 21, 2024
1 parent 8b9e967 commit 006d141
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ protected function cleanupAndCheckForEmpty($data)

public function getDataForEditmode(mixed $data, DataObject\Concrete $object = null, array $params = []): mixed
{
$permissions = $this->getPermissionResources();
foreach ($permissions as $permission) {
if (!array_key_exists($permission['value'], $data)) {
$data[$permission['value']] = Service::INHERIT;
}
}

return $data;
}

Expand Down

0 comments on commit 006d141

Please sign in to comment.