Examples of JspAuthorizeTag


Examples of org.springframework.security.taglibs.authz.JspAuthorizeTag

    /**
     * implementation of JspAuthorizeTag
     */
    private boolean ifGranted(String roles, int grantType) {
        JspAuthorizeTag authorizeTag = new JspAuthorizeTag();

        int result;

        try {
            switch (grantType) {
            case ALL_GRANTED:
                authorizeTag.setIfAllGranted(roles);

                break;

            case ANY_GRANTED:
                authorizeTag.setIfAnyGranted(roles);

                break;

            case NONE_GRANTED:
                authorizeTag.setIfNotGranted(roles);

                break;

            default:
                throw new IllegalArgumentException("invalid granted type : " + grantType + " role=" + roles);
            }

            result = authorizeTag.doStartTag();
        } catch (JspException je) {
            throw new IllegalArgumentException(je.getMessage());
        }

        return Tag.EVAL_BODY_INCLUDE == result;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.