mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-03 06:54:34 +02:00
Throw no warning, when unsetting a not existing permission value
This commit is contained in:
parent
9cd5d14708
commit
3f36972764
1 changed files with 2 additions and 2 deletions
|
@ -145,8 +145,8 @@ final class PermissionData implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
public function setPermissionValue(string $permission, string $operation, ?bool $value): self
|
public function setPermissionValue(string $permission, string $operation, ?bool $value): self
|
||||||
{
|
{
|
||||||
if ($value === null) {
|
//If the value is null, unset the permission value, if it was set befoere (meaning implicit inherit)
|
||||||
//If the value is null, unset the permission value (meaning implicit inherit)
|
if ($value === null && isset($this->data[$permission][$operation])) {
|
||||||
unset($this->data[$permission][$operation]);
|
unset($this->data[$permission][$operation]);
|
||||||
} else {
|
} else {
|
||||||
//Otherwise, set the pemission value
|
//Otherwise, set the pemission value
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue