Auto ac-checker on sib-forms/sib-display
I always workaround a lot of functions on sib-form or sib-display to create the exact same widget as the core one's but with a sib-ac-checker on top of it like that:
<sib-widget name="sib-action-custom">
<template>
<sib-ac-checker data-src="${src}" permission="acl:Write">
<sib-link data-src="${src}" next="${value}">${label}</sib-link>
</sib-ac-checker>
</template>
</sib-widget>
<sib-display
data-src='/server/path/'
fields="something"
label-something="Click here dude!"
action-something="anotherview"
widget-something='sib-action-custom'
></sib-display>
Notice that it's obvious on this lightened example that I could use the sib-ac-checker on top of the sib-display, but on more complex ones there are information that I still want to display even if the user does not have the acl:Write
permission.
--
For some use cases, like this one, I don't have a simple solution because needs could be different. But for sib-form
, it would be nice to check the acl:Write
on target data-src (or nested fields) and add, at least, a disabled
if the user can't save them by default.
There may be other generic situation that we could isolate like this one. It's pretty only UX case. "Why can I have a save
button if I'm not allowed to?".