Package io.undertow.security.api

Examples of io.undertow.security.api.RoleMappingManager


        return userPrincipal != null ? userPrincipal.getName() : null;
    }

    @Override
    public boolean isUserInRole(final String role) {
        final RoleMappingManager roleMappings = exchange.getAttachment(ServletAttachments.SERVLET_ROLE_MAPPINGS);
        if (roleMappings == null) {
            return false;
        }
        SecurityContext sc = exchange.getAttachment(SecurityContext.ATTACHMENT_KEY);
        final ServletChain servlet = exchange.getAttachment(ServletAttachments.CURRENT_SERVLET);
        //TODO: a more efficient imple
        for (SecurityRoleRef ref : servlet.getManagedServlet().getServletInfo().getSecurityRoleRefs()) {
            if (ref.getRole().equals(role)) {
                return roleMappings.isUserInRole(ref.getLinkedRole(), sc);
            }
        }
        return roleMappings.isUserInRole(role, sc);
    }
View Full Code Here

TOP

Related Classes of io.undertow.security.api.RoleMappingManager

Copyright © 2018 www.massapicom. 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.