You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Commands/UpdateRolePermissionsCommand.php
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ protected function configure()
14
14
{
15
15
$this->setName('auth:update-role-permissions')
16
16
->setDescription('Updates Roles and Permissions according to a definitions specified in the application. Useful if the application does not allow users to customise role permissions.')
17
-
->addArgument('force');
17
+
->addOption('f', null, null, 'Forces update - does not prompt user');
18
18
19
19
parent::configure();
20
20
}
@@ -23,21 +23,27 @@ protected function executeWithConnection(InputInterface $input, OutputInterface
23
23
{
24
24
$helper = $this->getHelper('question');
25
25
26
-
$force = $input->getArgument('force') === '-f';
26
+
$force = $input->getOption('f');
27
27
28
+
if (!$force) {
29
+
$output->writeln('<comment>Warning: New roles may be created, and all permissions associated with a role may be updated/removed if not specified in RolePermissionDefinitions.</comment>');
30
+
}
28
31
$verify = newQuestion(
29
-
'Warning: New roles may be created, and all permissions associated with a role may be updated/removed if not specified in RolePermissionDefinitions. Are you sure you want to proceed? [y/n] '
32
+
'<question>Are you sure you want to proceed? [y/n] </question>'
30
33
);
31
34
$verify->setValidator(function ($value) use ($output) {
32
35
if (stripos($value, 'y') !== 0) {
33
-
$output->writeln('Aborted');
36
+
$output->writeln('<error>Aborted</error>');
34
37
returnfalse;
35
38
}
36
39
returntrue;
37
40
});
38
41
if ($force || $helper->ask($input, $output, $verify)) {
42
+
if (!$force) {
43
+
$output->writeln('<comment>If you would like to suppress user verification in the future, use the --f option</comment>');
0 commit comments