auth tests
This commit is contained in:
42
backend/database/seeders/UserRoleSeeder.php
Normal file
42
backend/database/seeders/UserRoleSeeder.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Lists\UserRole;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class UserRoleSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Ruoli applicativi di base. Idempotente.
|
||||
* (description in inglese: lingua ufficiale dell'applicazione.)
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
UserRole::updateOrCreate(
|
||||
['name' => UserRole::ADMIN],
|
||||
['description' => 'Full access to all features.'
|
||||
.' Manages users, configurations and global data supervision.'
|
||||
.' Can create, read, update and delete any record.']
|
||||
);
|
||||
|
||||
UserRole::updateOrCreate(
|
||||
['name' => UserRole::SUPERVISOR],
|
||||
['description' => 'Limited access to certain features.'
|
||||
.' Can manage users but not administrators.'
|
||||
.' Can create, read, update and delete both own and other users\' records.']
|
||||
);
|
||||
|
||||
UserRole::updateOrCreate(
|
||||
['name' => UserRole::USER],
|
||||
['description' => 'Day-to-day operational use. Can access all records'
|
||||
.' and create new ones, but can only update or delete their own.']
|
||||
);
|
||||
|
||||
UserRole::updateOrCreate(
|
||||
['name' => UserRole::GUEST],
|
||||
['description' => 'Very limited access. Can only view information'
|
||||
.' not publicly available, with no editing capabilities.']
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user