Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
3ae3f77f
Unverified
Commit
3ae3f77f
authored
Oct 10, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding new asgard:user:grant-permissions command to grant all module permissions to admin role
parent
cfa3997d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
+52
-0
GrantRolePermissionsCommand.php
Modules/User/Console/GrantRolePermissionsCommand.php
+45
-0
UserServiceProvider.php
Modules/User/Providers/UserServiceProvider.php
+4
-0
changelog.yml
Modules/User/changelog.yml
+3
-0
No files found.
Modules/User/Console/GrantRolePermissionsCommand.php
0 → 100644
View file @
3ae3f77f
<?php
namespace
Modules\User\Console
;
use
Illuminate\Console\Command
;
use
Modules\User\Permissions\PermissionsAdder
;
use
Symfony\Component\Console\Input\InputArgument
;
class
GrantRolePermissionsCommand
extends
Command
{
protected
$name
=
'asgard:user:grant-permissions'
;
protected
$description
=
'Grant all the permissions to the admin role of given module'
;
public
function
handle
()
{
$module
=
$this
->
argument
(
'module'
);
(
new
PermissionsAdder
(
$module
))
->
addAll
();
$this
->
info
(
"All permissions for [
$module
] have been added to the admin role"
);
}
/**
* Get the console command arguments.
*
* @return array
*/
protected
function
getArguments
()
{
return
[
[
'module'
,
InputArgument
::
REQUIRED
,
'Module name'
],
];
}
/**
* Get the console command options.
*
* @return array
*/
protected
function
getOptions
()
{
return
[
];
}
}
Modules/User/Providers/UserServiceProvider.php
View file @
3ae3f77f
...
...
@@ -8,6 +8,7 @@ use Illuminate\Support\ServiceProvider;
use
Modules\Core\Events\BuildingSidebar
;
use
Modules\Core\Traits\CanGetSidebarClassForModule
;
use
Modules\Core\Traits\CanPublishConfiguration
;
use
Modules\User\Console\GrantRolePermissionsCommand
;
use
Modules\User\Contracts\Authentication
;
use
Modules\User\Entities\UserToken
;
use
Modules\User\Events\Handlers\RegisterUserSidebar
;
...
...
@@ -66,6 +67,9 @@ class UserServiceProvider extends ServiceProvider
BuildingSidebar
::
class
,
$this
->
getSidebarClassForModule
(
'user'
,
RegisterUserSidebar
::
class
)
);
$this
->
commands
([
GrantRolePermissionsCommand
::
class
,
]);
}
/**
...
...
Modules/User/changelog.yml
View file @
3ae3f77f
url
:
https://github.com/AsgardCms/Platform
versions
:
"
3.2.0@unreleased"
:
added
:
-
Adding new <code>asgard:user:grant-permissions</code> command to grant all module permissions to admin role
"
3.1.0"
:
added
:
-
Seeding new media.folders permissions on install
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment