Fix ownership verification - Closes #305, closes #320

This commit is contained in:
Bubka 2024-03-14 14:49:49 +01:00
parent 480268a606
commit e956959f69
4 changed files with 13 additions and 3 deletions

View File

@ -52,6 +52,7 @@ class Group extends Model
*/ */
protected $casts = [ protected $casts = [
'twofaccounts_count' => 'integer', 'twofaccounts_count' => 'integer',
'user_id' => 'integer',
]; ];
/** /**

View File

@ -145,7 +145,9 @@ class TwoFAccount extends Model implements Sortable
* *
* @var array<string, string> * @var array<string, string>
*/ */
protected $casts = []; protected $casts = [
'user_id' => 'integer',
];
/** /**
* The event map for the model. * The event map for the model.

View File

@ -27,7 +27,11 @@ class GroupModelTest extends ModelTestCase
['created_at', 'updated_at'], ['created_at', 'updated_at'],
['*'], ['*'],
[], [],
['id' => 'int', 'twofaccounts_count' => 'integer'], [
'id' => 'int',
'twofaccounts_count' => 'integer',
'user_id' => 'integer'
],
[ [
'deleting' => GroupDeleting::class, 'deleting' => GroupDeleting::class,
'deleted' => GroupDeleted::class, 'deleted' => GroupDeleted::class,

View File

@ -33,7 +33,10 @@ class TwoFAccountModelTest extends ModelTestCase
[], [],
['*'], ['*'],
[], [],
['id' => 'int'], [
'id' => 'int',
'user_id' => 'integer'
],
['deleted' => TwoFAccountDeleted::class], ['deleted' => TwoFAccountDeleted::class],
['created_at', 'updated_at'], ['created_at', 'updated_at'],
\Illuminate\Database\Eloquent\Collection::class, \Illuminate\Database\Eloquent\Collection::class,