Package org.focusns.model.core

Examples of org.focusns.model.core.ProjectAuthority


    private ProjectPermissionDao projectPermissionDao;

    @Test
    public void testInsert() {
        //
        ProjectAuthority projectAuthority = new ProjectAuthority();
        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 ProjectAuthorityDao projectAuthorityDao;

    @Test
    public void testInsert() {
        ProjectAuthority authority = new ProjectAuthority();
        authority.setCode("project-profile-view");
        authority.setDescription("查看主页模块");
        //
        this.projectAuthorityDao.insert(authority);
    }
View Full Code Here

        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);
        }
        //
        return permission;
    }
View Full Code Here

            // project role
            projectRole.setProjectId(project.getId());
            projectRoleDao.insert(projectRole);
            for(ProjectAuthority projectAuthority : projectTemplate.getProjectAuthorities(projectRole)) {
                // project authority
                ProjectAuthority _projectAuthority = projectAuthorityDao.selectByCode(projectAuthority.getCode());
                // project permission
                ProjectPermission projectPermission = new ProjectPermission();
                projectPermission.setProjectId(project.getId());
                projectPermission.setProjectRoleId(projectRole.getId());
                projectPermission.setProjectAuthorityId(_projectAuthority.getId());
                projectPermission.setEnabled(projectAuthority.isEnabled());
                //
                projectPermissionDao.insert(projectPermission);
            }
        }
View Full Code Here

            // project authorities
            List<ProjectAuthority> projectAuthorities = new ArrayList<ProjectAuthority>();
            List<Element> _authorityEles = DomUtils.getChildElementsByTagName(roleEle, "authority");
            for(Element authorityEle : _authorityEles) {
                // project authority
                ProjectAuthority projectAuthority = new ProjectAuthority();
                projectAuthority.setCode(authorityEle.getAttribute("code"));
                projectAuthority.setEnabled("true".equals(authorityEle.getAttribute("enabled")));
                projectAuthorities.add(projectAuthority);
            }
            //
            projectTemplate.addProjectRoleAuthorities(projectRole, projectAuthorities);
        }
View Full Code Here

TOP

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

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.