diff --git a/ui/src/views/JobList.vue b/ui/src/views/JobList.vue index dd9d8c4..bb1185f 100644 --- a/ui/src/views/JobList.vue +++ b/ui/src/views/JobList.vue @@ -1,15 +1,52 @@ @@ -18,7 +55,6 @@ import Vue from "vue"; import {JobResponse} from "@/client"; import {API} from "@/services/api"; -import List from "../components/List.vue"; interface State { jobs: Array; @@ -26,10 +62,15 @@ interface State { export default Vue.extend({ name: "JobList", - components: {List}, + components: {}, data: (): State => ({ jobs: [], }), + computed: { + canWrite: function (): boolean { + return this.hasRole("admin:job:write"); + }, + }, methods: { loadJobs() { API.listJobs().then((response) => { @@ -38,6 +79,12 @@ export default Vue.extend({ } }); }, + hasRole: function (s: string): boolean { + if (this.$store.state.user.roles) { + return this.lodash.includes(this.$store.state.user.roles, s); + } + return false; + } }, mounted() { this.loadJobs();