Hi,
Is that possible to evaluate result of allow & deny rules without doing database operation?
For example, I got defined “allow” rule for insert operation and I want to show/hide “insert” button in UI by evaluating allow rule in helper (helper returns CSS class “hidden” or “”).
Of course, I can repeat the same rule in helper, but that’s duplication of code - If I have complex allow/deny rules (and many UI components to show/hide) maintaining that code is nightmare.
Something like:
"insertButtonClass": function() {
if(Collection.insertIsAllowed()) {
return "";
}
return "hidden";
}
And I got:
<button id="insert-button" class="btn {{insertButtonClass}}">
Thanks!