fix: [user init] generation fixed

pull/92/head
iglocska 2021-11-24 23:59:34 +01:00
parent b009191aa6
commit c2cefb4311
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
3 changed files with 3 additions and 11 deletions

View File

@ -10,10 +10,5 @@ class Organisation extends AppModel
protected $_accessible = [
'*' => true,
'id' => false,
'uuid' => false,
];
protected $_accessibleOnNew = [
'uuid' => true,
];
}

View File

@ -11,17 +11,13 @@ class OrganisationsTable extends AppTable
{
public $metaFields = 'organisation';
protected $_accessible = [
'id' => false
];
public function initialize(array $config): void
{
parent::initialize($config);
$this->addBehavior('UUID');
$this->addBehavior('Timestamp');
$this->addBehavior('Tags.Tag');
$this->addBehavior('AuditLog');
$this->addBehavior('UUID');
$this->hasMany(
'Alignments',
[

View File

@ -122,7 +122,8 @@ class UsersTable extends AppTable
$this->Roles->save($role);
$this->Organisations = TableRegistry::get('Organisations');
$organisation = $this->Organisations->newEntity([
'name' => 'default_organisation'
'name' => 'default_organisation',
'uuid' => Text::uuid()
]);
$this->Organisations->save($organisation);
$this->Individuals = TableRegistry::get('Individuals');