mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-25 19:28:51 +02:00
Do not enable the create part from provider permission automatically
This allows users to create new datastructures, which is maybe not wanted. Besides it has to be configured first.
This commit is contained in:
parent
7b61cb3163
commit
d10d29e590
3 changed files with 1 additions and 23 deletions
|
@ -138,13 +138,4 @@ class PermissionSchemaUpdater
|
|||
$holder->getPermissions()->removePermission('devices');
|
||||
}
|
||||
}
|
||||
|
||||
private function upgradeSchemaToVersion3(HasPermissionsInterface $holder): void //@phpstan-ignore-line This is called via reflection
|
||||
{
|
||||
//If the info_providers permissions are not defined yet, set it if the user can create parts
|
||||
if (!$holder->getPermissions()->isAnyOperationOfPermissionSet('info_providers')) {
|
||||
$user_can_create_parts = $holder->getPermissions()->getPermissionValue('parts', 'create');
|
||||
$holder->getPermissions()->setPermissionValue('info_providers', 'create_parts', $user_can_create_parts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue