-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
im still struggling a little bit with the Spring Security Integration. I understand that i can not use (custom) tag libraries in zul pages (in a portlet environment). But how can i disable page regions or components based on the user authorities? I've seen a post in this forum where a user builds the menucomponents onCreation of the window. but this feels just way to awkward somehow (at least to me). isnt there a better way to solve this? taglibraries would be the answer but when those arent working, isnt there something else?
im new to zk, normally in jsf i would have a backing bean, like the SecurityUtil to ask, whether or not to render a component in the window? cant i access that bean with some kind of expressionlanguage?
something like that:
<button onClick="win.safe()" visible="SecurityUtil.isAllGranted('Role_Administrator')"/>
thanks for your help
@fabian
Hi fabian, here is a sample for you.
In zul
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?> <?taglib uri="/WEB-INF/tld/my.tld" prefix="z"?> ... <button if="${z:authorize('Role_Administrator')}" />
In tld
<?xml version="1.0" encoding="ISO-8859-1" ?> <taglib> <tlib-version>1.0</tlib-version> <jspversion>1.1</jspversion> <uri>http://www.mytld.com/tld/</uri> <function> <name>authorize</name> <function-class>com.mytld.util.MyUtil</function-class> <function-signature>boolean authorize(java.lang.String);</function-signature> <description>Remove html tags of text.</description> </function> ... </taglib>
Otherwise, you just write a normal java method in the com.mytld.util.MyUtil (name and return must be the same with function-signature).
Regards
/Joy
Asked: 2009-10-26 12:21:41 +0800
Seen: 235 times
Last updated: Oct 26 '09