Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<template>
<b-modal id="confirm-remove-permission-modal" title="Confirm action" ok-title="Remove" @ok="removePermission" ok-variant="danger">
<p v-if="user">Are you sure that you want to remove the permission for the user {{user.displayName}}?</p>
</b-modal>
</template>
<script>
import client from 'api-client';
import { mapState, mapActions } from 'vuex';
export default {
name: 'ConfirmRemovePermissionModal',
data: function() {
return {
user: null
}
},
computed: mapState({
model: state => state.model
}),
methods: {
openRemovePermissionModal: function(user) {
this.user = user;
this.$bvModal.show('confirm-remove-permission-modal');
},
removePermission: function(event) {
// Prevent modal from closing
event.preventDefault();
client.removePermission(this.user.id, this.$store.state.input)
.then(res => {
this.$store.commit('updatePermissionsPanel', res);
this.$bvModal.hide('confirm-remove-permission-modal');
});
}
}
}
</script>