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:
Jan Böhmer 2023-07-17 00:20:38 +02:00
parent 7b61cb3163
commit d10d29e590
3 changed files with 1 additions and 23 deletions

View file

@ -110,17 +110,4 @@ class PermissionSchemaUpdaterTest extends WebTestCase
self::assertEquals(PermissionData::INHERIT, $user->getPermissions()->getPermissionValue('projects', 'edit'));
self::assertEquals(PermissionData::DISALLOW, $user->getPermissions()->getPermissionValue('projects', 'delete'));
}
public function testUpgradeSchemaToVersion3(): void
{
$perm_data = new PermissionData();
$perm_data->setSchemaVersion(2);
$perm_data->setPermissionValue('parts', 'create', PermissionData::ALLOW);
$user = new TestPermissionHolder($perm_data);
//After the upgrade the user should be allowed to create parts from info providers
self::assertTrue($this->service->upgradeSchema($user, 3));
self::assertEquals(PermissionData::ALLOW, $user->getPermissions()->getPermissionValue('info_providers', 'create_parts'));
}
}