fix: [user init] explicit uuid creation removed

- added behavior wherever it was missing
pull/92/head
iglocska 2021-11-24 23:32:17 +01:00
parent 716f6b1147
commit c7768921fb
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 2 additions and 5 deletions

View File

@ -21,6 +21,7 @@ class OrganisationsTable extends AppTable
$this->addBehavior('Timestamp');
$this->addBehavior('Tags.Tag');
$this->addBehavior('AuditLog');
$this->addBehavior('UUID');
$this->hasMany(
'Alignments',
[

View File

@ -115,7 +115,6 @@ class UsersTable extends AppTable
$this->Roles = TableRegistry::get('Roles');
$role = $this->Roles->newEntity([
'name' => 'admin',
'uuid' => Text::uuid(),
'perm_admin' => 1,
'perm_org_admin' => 1,
'perm_sync' => 1
@ -123,21 +122,18 @@ class UsersTable extends AppTable
$this->Roles->save($role);
$this->Organisations = TableRegistry::get('Organisations');
$organisation = $this->Organisations->newEntity([
'name' => 'default_organisation',
'uuid' => Text::uuid()
'name' => 'default_organisation'
]);
$this->Organisations->save($organisation);
$this->Individuals = TableRegistry::get('Individuals');
$individual = $this->Individuals->newEntity([
'email' => 'admin@admin.test',
'uuid' => Text::uuid(),
'first_name' => 'admin',
'last_name' => 'admin'
]);
$this->Individuals->save($individual);
$user = $this->newEntity([
'username' => 'admin',
'uuid' => Text::uuid(),
'password' => 'Password1234',
'individual_id' => $individual->id,
'oganisation_id' => $organisation->id,