I've enabled EL support for the authz tag. We pull
content items from a CMS for display. The content
items will have ifAllGranted, ifAnyGranted, and
ifNotGranted attributes which with EL we can pull at
runtime from the content item into the authz tags.
Below is the code. What do you all think of it?

TIA,
Scott

...
import
org.springframework.web.util.ExpressionEvaluationUtils;
...
public class AuthorizeTag extends TagSupport {
...
    public int doStartTag() throws JspException {
        if (((null == ifAllGranted) ||
"".equals(ifAllGranted))
            && ((null == ifAnyGranted) ||
"".equals(ifAnyGranted))
            && ((null == ifNotGranted) ||
"".equals(ifNotGranted))) {
            return Tag.SKIP_BODY;
        }

        ifAllGranted =
ExpressionEvaluationUtils.evaluateString("ifAllGranted",
ifAllGranted, pageContext);
        ifAnyGranted =
ExpressionEvaluationUtils.evaluateString("ifAnyGranted",
ifAnyGranted, pageContext);
        ifNotGranted =
ExpressionEvaluationUtils.evaluateString("ifNotGranted",
ifNotGranted, pageContext);

...


                
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Acegisecurity-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer

Reply via email to