Package org.focusns.service.core

Examples of org.focusns.service.core.ProjectUserService


        //
        boolean isAllowed = super.isAccessAllowed(request, response, mappedValue);
        Object sessionUser = webSubject.getSession().getAttribute(ProjectUser.class.getName());
        if(isAllowed && sessionUser==null) {
            //
            ProjectUserService projectUserService = beanFactory.getBean(ProjectUserService.class);
            String username = webSubject.getPrincipal().toString();
            ProjectUser projectUser = projectUserService.getProjectUser(username);
            //
            webSubject.getSession().setAttribute("projectUser", projectUser);
            webSubject.getSession().setAttribute(ProjectUser.class.getName(), projectUser);
        }
        //
View Full Code Here


    }

    @Override
    protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
        //
        ProjectUserService projectUserService = beanFactory.getBean(ProjectUserService.class);
        UsernamePasswordToken usernamePasswordToken = (UsernamePasswordToken) token;
        Assert.hasText(usernamePasswordToken.getUsername(), "Username can not be null!");
        ProjectUser projectUser = projectUserService.getProjectUser(usernamePasswordToken.getUsername());
        //
        Assert.notNull(projectUser,String.format("User not found for username %s", usernamePasswordToken.getUsername()));
        //
        return new SimpleAuthenticationInfo(projectUser.getUsername(), projectUser.getPassword(), REALM_NAME);
    }
View Full Code Here

    @Override
    protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
        //
        SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
        //
        ProjectUserService projectUserService = beanFactory.getBean(ProjectUserService.class);
        ProjectRoleService projectRoleService = beanFactory.getBean(ProjectRoleService.class);
        ProjectMemberService projectMemberService = beanFactory.getBean(ProjectMemberService.class);
        ProjectAuthorityService projectAuthorityService = beanFactory.getBean(ProjectAuthorityService.class);
        //
        Project project = getProjectFromWebSubject();
View Full Code Here

TOP

Related Classes of org.focusns.service.core.ProjectUserService

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.