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
94a979c5
Unverified
Commit
94a979c5
authored
Oct 11, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding the ability to allow, inherit or deny for all permissions at once
parent
28d49acb
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
301 additions
and
192 deletions
+301
-192
AsgardPermissions.vue
Modules/User/Assets/js/components/AsgardPermissions.vue
+20
-0
app.js
public/js/app.js
+281
-192
No files found.
Modules/User/Assets/js/components/AsgardPermissions.vue
View file @
94a979c5
<
template
>
<div>
<p
class=
"pull-right"
>
<el-button
type=
"text"
@
click=
"changeStateForAll(1)"
>
{{
trans
(
'
roles.allow all
'
)
}}
</el-button>
<el-button
type=
"text"
:disabled=
"isRole"
@
click=
"changeStateForAll(0)"
>
{{
trans
(
'
roles.inherit all
'
)
}}
</el-button>
<el-button
type=
"text"
@
click=
"changeStateForAll(-1)"
>
{{
trans
(
'
roles.deny all
'
)
}}
</el-button>
</p>
<div
v-for=
"(value, name) in allPermissions"
:key=
"name"
>
<h3>
{{
name
}}
</h3>
<div
v-for=
"(permissionActions, subPermissionTitle) in value"
:key=
"subPermissionTitle"
>
...
...
@@ -84,6 +99,11 @@
this
.
permissions
[
`
${
permissionPart
}
.
${
key
}
`
]
=
state
;
});
},
changeStateForAll
(
state
)
{
_
.
forEach
(
this
.
permissions
,
(
index
,
permission
)
=>
{
this
.
permissions
[
permission
]
=
state
;
});
},
fetchPermissions
()
{
axios
.
get
(
route
(
'
api.user.permissions.index
'
))
.
then
((
response
)
=>
{
...
...
public/js/app.js
View file @
94a979c5
This diff is collapsed.
Click to expand it.
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