68 lines
1.6 KiB
PHP
68 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace IriksIT\Manager\Modules\Users;
|
|
|
|
use IriksIT\Manager\Modules\BaseModule;
|
|
use IriksIT\Manager\Support\Names;
|
|
use IriksIT\Manager\Support\Permission;
|
|
|
|
class UsersModule extends BaseModule
|
|
{
|
|
public function key(): string
|
|
{
|
|
return 'users';
|
|
}
|
|
|
|
public function label(): string
|
|
{
|
|
return 'Users';
|
|
}
|
|
|
|
public function enabledByDefault(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function tables(): array
|
|
{
|
|
return ['groups', 'group_user'];
|
|
}
|
|
|
|
public function permissions(): array
|
|
{
|
|
return [
|
|
new Permission('accounts.manage', 'Create, change and delete accounts, and put them in groups', 'Accounts'),
|
|
];
|
|
}
|
|
|
|
public function navigation(): array
|
|
{
|
|
return [
|
|
['label' => 'Accounts', 'route' => Names::route('accounts.index'), 'permission' => 'accounts.manage'],
|
|
['label' => 'Groups', 'route' => Names::route('groups.index'), 'permission' => 'groups.manage'],
|
|
];
|
|
}
|
|
|
|
public function actions(): array
|
|
{
|
|
return [
|
|
'accounts.store' => ['Created an account'],
|
|
'accounts.update' => ['Changed an account'],
|
|
'accounts.destroy' => ['Deleted an account'],
|
|
'groups.store' => ['Created a group'],
|
|
'groups.update' => ['Changed a group'],
|
|
'groups.destroy' => ['Deleted a group'],
|
|
];
|
|
}
|
|
|
|
public function views(): array
|
|
{
|
|
return ['accounts.index' => 'Opened the accounts', 'groups.index' => 'Opened the groups'];
|
|
}
|
|
|
|
public function commands(): array
|
|
{
|
|
return [CreateManagerUser::class];
|
|
}
|
|
}
|