fix: [user init] generation fixed
parent
b009191aa6
commit
c2cefb4311
|
@ -10,10 +10,5 @@ class Organisation extends AppModel
|
||||||
protected $_accessible = [
|
protected $_accessible = [
|
||||||
'*' => true,
|
'*' => true,
|
||||||
'id' => false,
|
'id' => false,
|
||||||
'uuid' => false,
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $_accessibleOnNew = [
|
|
||||||
'uuid' => true,
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,17 +11,13 @@ class OrganisationsTable extends AppTable
|
||||||
{
|
{
|
||||||
public $metaFields = 'organisation';
|
public $metaFields = 'organisation';
|
||||||
|
|
||||||
protected $_accessible = [
|
|
||||||
'id' => false
|
|
||||||
];
|
|
||||||
|
|
||||||
public function initialize(array $config): void
|
public function initialize(array $config): void
|
||||||
{
|
{
|
||||||
parent::initialize($config);
|
parent::initialize($config);
|
||||||
|
$this->addBehavior('UUID');
|
||||||
$this->addBehavior('Timestamp');
|
$this->addBehavior('Timestamp');
|
||||||
$this->addBehavior('Tags.Tag');
|
$this->addBehavior('Tags.Tag');
|
||||||
$this->addBehavior('AuditLog');
|
$this->addBehavior('AuditLog');
|
||||||
$this->addBehavior('UUID');
|
|
||||||
$this->hasMany(
|
$this->hasMany(
|
||||||
'Alignments',
|
'Alignments',
|
||||||
[
|
[
|
||||||
|
|
|
@ -122,7 +122,8 @@ class UsersTable extends AppTable
|
||||||
$this->Roles->save($role);
|
$this->Roles->save($role);
|
||||||
$this->Organisations = TableRegistry::get('Organisations');
|
$this->Organisations = TableRegistry::get('Organisations');
|
||||||
$organisation = $this->Organisations->newEntity([
|
$organisation = $this->Organisations->newEntity([
|
||||||
'name' => 'default_organisation'
|
'name' => 'default_organisation',
|
||||||
|
'uuid' => Text::uuid()
|
||||||
]);
|
]);
|
||||||
$this->Organisations->save($organisation);
|
$this->Organisations->save($organisation);
|
||||||
$this->Individuals = TableRegistry::get('Individuals');
|
$this->Individuals = TableRegistry::get('Individuals');
|
||||||
|
|
Loading…
Reference in New Issue