PR CI / flow (pull_request) Successful in 4s
PR CI / ledger (pull_request) Successful in 3s
PR CI / test (stable) (pull_request) Successful in 38s
PR CI / test (lowest) (pull_request) Successful in 44s
PR CI / security (pull_request) Successful in 51s
PR CI / pr-ci (pull_request) Successful in 1s
PR CI / release-automerge (pull_request) Successful in 3s
67 lines
1.6 KiB
PHP
67 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace IriksIT\Manager\Modules\Users;
|
|
|
|
use IriksIT\Manager\Modules\BaseModule;
|
|
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' => 'manager.accounts.index', 'permission' => 'accounts.manage'],
|
|
['label' => 'Groups', 'route' => 'manager.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];
|
|
}
|
|
}
|