Package org.focusns.model.core

Examples of org.focusns.model.core.ProjectRole


    @RequestMapping(value="/role-edit")
    public String doEdit(@RequestParam(required = false) Long roleId, @WidgetAttribute Project project,
                         @WidgetAttribute ProjectUser projectUser, Model model) {
        //
        ProjectRole projectRole = new ProjectRole();
        if(roleId==null) {
            projectRole.setProjectId(project.getId());
        } else {
            projectRole = projectRoleService.getProjectRole(roleId);
        }
        //
        List<ProjectRole> projectRoles = projectRoleService.listProjectRoles(project.getId());
View Full Code Here


        }
    }

    @RequestMapping(value="/role-remove")
    public void doRemove(@RequestParam Long id) {
        ProjectRole projectRole = projectRoleService.getProjectRole(id);
        projectRoleService.removeProjectRole(projectRole);
        Navigator.get().withAttribute("projectRole", projectRole).navigateTo("role-removed");
    }
View Full Code Here

    @RequestMapping(value="/role-edit", method = GET)
    public String doEdit(@RequestParam(required = false) Long roleId, @WidgetAttribute Project project,
                         @WidgetAttribute ProjectUser projectUser, Model model) {
        //
        ProjectRole projectRole = new ProjectRole();
        if(roleId==null) {
            projectRole.setProjectId(project.getId());
        } else {
            projectRole = projectRoleService.getProjectRole(roleId);
        }
        //
        List<ProjectRole> projectRoles = projectRoleService.listProjectRoles(project.getId());
View Full Code Here

        }
    }

    @RequestMapping(value="/role-remove", method = GET)
    public void doRemove(@RequestParam Long id) {
        ProjectRole projectRole = projectRoleService.getProjectRole(id);
        projectRoleService.removeProjectRole(projectRole);
        Navigator.get().withAttribute("projectRole", projectRole).navigateTo("role-removed");
    }
View Full Code Here

    private ProjectDao projectDao;
    @Autowired
    private ProjectRoleDao projectRoleDao;

    public ProjectRole getProjectRole(long roleId) {
        ProjectRole projectRole = projectRoleDao.select(roleId);
        return projectRole;
    }
View Full Code Here

        projectAuthority.setCode("project-admin-view");
        projectAuthority.setDescription("管理模块查看权力");
        //
        projectAuthorityDao.insert(projectAuthority);
        //
        ProjectRole projectRole  = new ProjectRole();
        projectRole.setProjectId(1);
        projectRole.setLabel("管理员");
        projectRole.setLevel(5);
        //
        projectRoleDao.insert(projectRole);
        //
        ProjectPermission projectPermission = new ProjectPermission();
        projectPermission.setProjectId(1);
        projectPermission.setProjectRoleId(projectRole.getId());
        projectPermission.setProjectAuthorityId(projectAuthority.getId());
        //
        projectPermissionDao.insert(projectPermission);
    }
View Full Code Here

    @Autowired
    private ProjectRoleDao projectRoleDao;

    @Test
    public void testInsert() {
        ProjectRole role = new ProjectRole();
        role.setLabel("管理员");
        role.setLevel(0);
        role.setProjectId(1);
        //
        this.projectRoleDao.insert(role);
    }
View Full Code Here

    @Override
    public Map<ProjectRole, List<ProjectPermission>> listProjectPermissionsAsMap(long projectId) {
        List<ProjectPermission> projectPermissions = listProjectPermissions(projectId);
        //
        ProjectRole prevProjectRole = null;
        List<ProjectPermission> projectPermissionList = new ArrayList<ProjectPermission>();
        Map<ProjectRole, List<ProjectPermission>> projectRolePermissionMap = new LinkedHashMap<ProjectRole, List<ProjectPermission>>();
        for(ProjectPermission projectPermission : projectPermissions) {
            //
            if(prevProjectRole!=null && prevProjectRole.getId()!=projectPermission.getProjectRoleId()) {
                projectRolePermissionMap.put(prevProjectRole, projectPermissionList);
                projectPermissionList = new ArrayList<ProjectPermission>();
            }
            //
            projectPermissionList.add(projectPermission);
View Full Code Here

        if(permission.getProject()==null && permission.getProjectId()>0) {
            Project project = projectDao.select(permission.getProjectId());
            permission.setProject(project);
        }
        if(permission.getProjectRole()==null && permission.getProjectRoleId()>0) {
            ProjectRole projectRole = projectRoleDao.select(permission.getProjectRoleId());
            permission.setProjectRole(projectRole);
        }
        if(permission.getProjectAuthority()==null && permission.getProjectAuthorityId()>0) {
            ProjectAuthority projectAuthority = projectAuthorityDao.select(permission.getProjectAuthorityId());
            permission.setProjectAuthority(projectAuthority);
View Full Code Here

        if(teamMember.getUser()==null && teamMember.getUserId()>0) {
            ProjectUser projectUser = projectUserDao.selectWithProject(teamMember.getUserId());
            teamMember.setUser(projectUser);
        }
        if(teamMember.getRole()==null && teamMember.getRoleId()>0) {
            ProjectRole projectRole = projectRoleDao.select(teamMember.getRoleId());
            teamMember.setRole(projectRole);
        }
        //
        return teamMember;
    }
View Full Code Here

TOP

Related Classes of org.focusns.model.core.ProjectRole

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.