summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/PermissionModuleGrantRevoke.vue
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/src/components/PermissionModuleGrantRevoke.vue')
-rw-r--r--webapp/src/components/PermissionModuleGrantRevoke.vue14
1 files changed, 9 insertions, 5 deletions
diff --git a/webapp/src/components/PermissionModuleGrantRevoke.vue b/webapp/src/components/PermissionModuleGrantRevoke.vue
index 559fdfc..81afece 100644
--- a/webapp/src/components/PermissionModuleGrantRevoke.vue
+++ b/webapp/src/components/PermissionModuleGrantRevoke.vue
@@ -143,11 +143,15 @@ export default {
methods: {
async submit (event) {
const roleIds = this.selectedRoles.map(x => x.id)
- this.selectedUsers.forEach(user => {
- this.$http.post('/api/users/' + user.id + '/roles' + (this.grant ? '' : '/?delete'), { ids: roleIds })
- })
- this.$store.commit('newSnackbar', this.$t(this.grant ? 'roleGrantedSuccess' : 'roleRevokedSuccess'))
- this.$store.dispatch('permissions/loadData')
+ for (let i = 0; i < this.selectedUsers.length; i++) {
+ await this.$http.post('/api/users/' + this.selectedUsers[i].id + '/roles' + (this.grant ? '' : '/?delete'), { ids: roleIds })
+ }
+ if (this.grant) {
+ this.$snackbar({ color: 'success', text: this.$t('roleGrantedSuccess'), timeout: 15000 })
+ } else {
+ this.$snackbar({ color: 'success', text: this.$t('roleRevokedSuccess'), timeout: 15000 })
+ }
+ this.$store.dispatch('permissions/loadUserData')
this.$store.commit('permissions/setGrantRevoke', false)
this.$store.commit('permissions/setSelectedUsers', [])
},