diff --git a/ccp/js/methodlistcontroller.js b/ccp/js/methodlistcontroller.js index 771953d..6ee5d13 100644 --- a/ccp/js/methodlistcontroller.js +++ b/ccp/js/methodlistcontroller.js @@ -120,17 +120,16 @@ class CCPMethodList extends HTMLElement{ } connectedCallback(){ - + this.#allowedit = this.getAttribute("allow-edit") === "true" + this.#allowexecute = this.getAttribute("allow-execute") === "true" } fetchProcesses(){ console.log("Calling fetch processes") this.#boot.secureFetch(this.#serviceurl + "/methods"). then(resp=>{ - console.log("Received resp for processes ", resp.status) return resp.json() }).then(data=>{ - console.log("Processes parsed to json", data) this.#data = data this.updateList() return this.fetchInfrastructures() @@ -327,7 +326,11 @@ class CCPMethodList extends HTMLElement{ }, { target: "button[name=executable]", - apply : (e,d)=>{ e.style.display = d.executable ? "revert" : "none" } + apply : (e,d)=>{ e.style.display = d.executable && this.#allowexecute ? "revert" : "none" } + }, + { + target: "button[name=edit]", + apply : (e,d)=>{ e.style.display = this.#allowedit ? "revert" : "none" } }, { target : "span[name=author]",