forked from CakeDC/users
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsersAddSuperuserCommand.php
More file actions
42 lines (37 loc) · 1000 Bytes
/
UsersAddSuperuserCommand.php
File metadata and controls
42 lines (37 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
declare(strict_types=1);
namespace CakeDC\Users\Command;
use Cake\Command\Command;
use Cake\Console\Arguments;
use Cake\Console\ConsoleIo;
use CakeDC\Users\Command\Logic\CreateUserTrait;
use CakeDC\Users\Model\Table\UsersTable;
/**
* UsersAddSuperuser command.
*/
class UsersAddSuperuserCommand extends Command
{
use CreateUserTrait;
/**
* Implement this method with your command's logic.
*
* @param \Cake\Console\Arguments $args The command arguments.
* @param \Cake\Console\ConsoleIo $io The console io
* @return int|null|void The exit code or null for success
*/
public function execute(Arguments $args, ConsoleIo $io)
{
$this->_createUser($args, $io, [
'username' => 'superadmin',
'role' => UsersTable::ROLE_ADMIN,
'is_superuser' => true,
]);
}
/**
* @inheritDoc
*/
public static function defaultName(): string
{
return 'users add_superuser';
}
}