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
Show 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
...
...
@@ -106583,6 +106583,21 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
exports.default = {
mixins: [_StringHelpers2.default],
...
...
@@ -106614,12 +106629,19 @@ exports.default = {
_this.permissions[permissionPart + '.' + key] = state;
});
},
fetchPermissions: function fetchPermissions(
) {
changeStateForAll: function changeStateForAll(state
) {
var _this2 = this;
_.forEach(this.permissions, function (index, permission) {
_this2.permissions[permission] = state;
});
},
fetchPermissions: function fetchPermissions() {
var _this3 = this;
_axios2.default.get(route('api.user.permissions.index')).then(function (response) {
_this
2
.loading = false;
_this
2
.allPermissions = response.data.permissions;
_this
3
.loading = false;
_this
3
.allPermissions = response.data.permissions;
});
}
},
...
...
@@ -106645,6 +106667,71 @@ var render = function() {
var _c = _vm._self._c || _h
return _c(
"div",
[
_c(
"p",
{ staticClass: "pull-right" },
[
_c(
"el-button",
{
attrs: { type: "text" },
on: {
click: function($event) {
_vm.changeStateForAll(1)
}
}
},
[
_vm._v(
"\n " +
_vm._s(_vm.trans("roles.allow all")) +
"\n "
)
]
),
_vm._v(" "),
_c(
"el-button",
{
attrs: { type: "text", disabled: _vm.isRole },
on: {
click: function($event) {
_vm.changeStateForAll(0)
}
}
},
[
_vm._v(
"\n " +
_vm._s(_vm.trans("roles.inherit all")) +
"\n "
)
]
),
_vm._v(" "),
_c(
"el-button",
{
attrs: { type: "text" },
on: {
click: function($event) {
_vm.changeStateForAll(-1)
}
}
},
[
_vm._v(
"\n " +
_vm._s(_vm.trans("roles.deny all")) +
"\n "
)
]
)
],
1
),
_vm._v(" "),
_vm._l(_vm.allPermissions, function(value, name) {
return _c(
"div",
...
...
@@ -106850,6 +106937,8 @@ var render = function() {
2
)
})
],
2
)
}
var staticRenderFns = []
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