ui: Add support to filter Roles permissions (#5488)

This commit is contained in:
Pearl Dsilva 2021-09-21 20:08:50 +05:30 committed by GitHub
parent 67be3da36e
commit 5d63379ea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -171,9 +171,15 @@ export default {
}).finally(() => {
this.loadingTable = false
this.updateTable = false
this.updateApis()
if (callback) callback()
})
},
updateApis () {
this.apis = Object.keys(this.$store.getters.apis).sort((a, b) => a.localeCompare(b))
var apisSupported = this.rules?.map(rule => rule.rule) || []
this.apis = this.apis.filter(api => !apisSupported.includes(api))
},
changeOrder () {
api('updateRolePermission', {}, 'POST', {
roleid: this.resource.id,