Throw no warning, when unsetting a not existing permission value

This commit is contained in:
Jan Böhmer 2023-10-23 22:15:04 +02:00
parent 9cd5d14708
commit 3f36972764

View file

@ -145,8 +145,8 @@ final class PermissionData implements \JsonSerializable
*/
public function setPermissionValue(string $permission, string $operation, ?bool $value): self
{
if ($value === null) {
//If the value is null, unset the permission value (meaning implicit inherit)
//If the value is null, unset the permission value, if it was set befoere (meaning implicit inherit)
if ($value === null && isset($this->data[$permission][$operation])) {
unset($this->data[$permission][$operation]);
} else {
//Otherwise, set the pemission value