diff --git a/ui/lib/js/directives.js b/ui/lib/js/directives.js index e9b4ce7f..836c3178 100644 --- a/ui/lib/js/directives.js +++ b/ui/lib/js/directives.js @@ -15,6 +15,15 @@ const map = { }, 800) }) } + }, + permit: { + bind(el, binding) { + const code = binding.value + const permits = JSON.parse(localStorage.getItem('vuex') || null)?.user?.info?.buttons || [] + if (!permits.find(e => e.id == code || e.permission == code)) { + el.parentNode.removeChild(el) + } + } } }