-
FEATURED COMPONENTS
First time here? Check out the FAQ!
zul:
<button visible="@load(vm.allowed, right='btnTest')"
java:
public boolean isAllowed(@BindingParam("right") String right) {
// TODO get from GrantedRights (Spring)
System.out.println("XXXXXXXXXXXXX " + right);
return true;
}
I do not find usefull informations how the syntax goes right, or if this is not possible.
Thanks for all infos.
Stephan
I thought is was like this :
<button visible="@load(vm.isAllowed('btnTest')"/>
and you don't need to set the bindingparam.
As described in this topic.
Greetz chill.
Terry,
You use spring security
Maybe you can do this also (depends of course it has something to do with the roles) :
<?taglib uri="http://security/util" prefix="sec" ?>
<button if="${sec:isAnyGranted('ROLE_1,ROLE_2')}"/>
greetz chill.
Yes chill,
thanks for the hint.
best Stephan
Argh, i have tried a few things. Yours is better. Works. Great.
Many thanks chill
zul:
<button label="Add New" visible="@load(vm.isAllowed('btnNew'))" onClick="@command('onAddNew')"></button>
java: public class BaseVM {
/**
* Check if it's allowed. Checks against the SpringSecurity Granted Rights.
*
* @param rightname The right name.
* @return True if it's allowed otherwise false.
*/
public boolean allowed(String rightname) {
// TODO get from GrantedRights (Spring)
System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + rightname);
return true;
}
}
Asked: 2014-03-27 13:40:49 +0800
Seen: 80 times
Last updated: Mar 28 '14
Problem binding values to a composite component
How to access static member field of a class in zul without zscript
How can i load a constant in .zul
MVVM Validator: class not found ? [closed]
MVVM tab box - delay @load until tab pane displayed?
mvvm, load or save with after or before for seach command
how to fire an event when a variable value loaded through VM
is there any event trigger from zk component on binding ?
ZK team plans to dispose of Composer EventQueues no longer in scope? [closed]