Can anyone suggest me a way to set a conditional show/hide for every widget/UI component used based on permissions
I have a user model that has some “permissions” array
and I define permissions parameter with the list of required permissions to view this UI element
then somehow adopt this from a single place
ex.
view: ‘button’
label: ‘Add’
permissions: [‘add_item’]
and have a code somewhere in app.js
to control
if item.permissions !== undefined and !user_has_permission(item.permissions)
item.hide()
can’t find a way to attach this to every view