Merge pull request #2640 from jumpserver/pr@dev@ticket

perf: ticket perm
This commit is contained in:
feng626
2023-02-14 22:57:12 +08:00
committed by GitHub
2 changed files with 6 additions and 2 deletions

View File

@@ -188,7 +188,9 @@ export default {
hasActionPerm() {
const approval_step = this.object.approval_step.value
const current_user_id = this.$store.state.users.profile.id
return this.object.process_map[approval_step - 1].assignees.indexOf(current_user_id) !== -1
return this.object.process_map.filter(
item => item.approval_level === approval_step
)[0].assignees.indexOf(current_user_id) !== -1
}
},
methods: {

View File

@@ -105,7 +105,9 @@ export default {
},
computed: {
hasActionPerm() {
return this.object.process_map[this.object.approval_step.value - 1].assignees.indexOf(this.$store.state.users.profile.id) !== -1
return this.object.process_map.filter(
item => item.approval_level === this.object.approval_step.value
)[0].assignees.indexOf(this.$store.state.users.profile.id) !== -1
},
isSelfTicket() {
return this.object.applicant.id === this.$store.state.users.profile.id