Package vn.pyco.tinycms.services.impl

Examples of vn.pyco.tinycms.services.impl.UserDetailsImpl


        Node node = (Node) object;
        if (!node.isSecured()) {
            return ACCESS_GRANTED;
        }
       
        UserDetailsImpl details = getUserDetails(authentication);
        if (details == null) {
            return ACCESS_DENIED;
        }
       
        for (Object obj : config.getConfigAttributes()) {
            ConfigAttribute attribute = (ConfigAttribute) obj;
            List<String> subAttibutes = StringHelper.toList(attribute.getAttribute(), ",");
           
            if (subAttibutes.contains(Authority.ROLE_FOUSER) && details.getUser().getType() != UserType.NA) {
                return ACCESS_GRANTED;
            }
        }
        return ACCESS_DENIED;
    }
View Full Code Here


    /*
     * @see org.springframework.security.vote.RoleVoter#vote(org.springframework.security.Authentication, java.lang.Object, org.springframework.security.ConfigAttributeDefinition)
     */
    @Override
    public int vote(Authentication authentication, Object object, ConfigAttributeDefinition config) {
        UserDetailsImpl details = getUserDetails(authentication);
        if (details == null) {
            return ACCESS_DENIED;
        }
       
        GrantedAuthority[] authorities = details.getAuthorities();
        for (Object obj : config.getConfigAttributes()) {
            ConfigAttribute attribute = (ConfigAttribute) obj;
            List<String> subAttibutes = StringHelper.toList(attribute.getAttribute(), ",");
           
            if (subAttibutes.contains(Authority.ROLE_BOUSER) && details.getUser().getType() == UserType.BO) {
                return ACCESS_GRANTED;
            }

            if (!supports(attribute)) {
                continue;
View Full Code Here

    /*
     * @see vn.pyco.tinycms.web.services.security.BoRoleVoter#vote(org.springframework.security.Authentication, java.lang.Object, org.springframework.security.ConfigAttributeDefinition)
     */
    @Override
    public int vote(Authentication authentication, Object object, ConfigAttributeDefinition config) {
        UserDetailsImpl userDetails = getUserDetails(authentication);
        if (userDetails != null && userDetails.getUser().isSA()) {
            return ACCESS_GRANTED;
        }
       
        return ACCESS_DENIED;
    }
View Full Code Here

TOP

Related Classes of vn.pyco.tinycms.services.impl.UserDetailsImpl

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.