Package org.sete.domain

Examples of org.sete.domain.UserRolePrivilege


     *add a UserRolePrivilege("sponsor") with a UserPrivilege ("projIdea") of "r" allowed action*/
    private void testTwoUserRoleLoad(final UserRoleDao roleDao, final UserRoleServiceImpl roleService)
    {
        final ArrayList<UserRolePrivilege> rolePrivList = new ArrayList<UserRolePrivilege>(1);
       
        final UserRolePrivilege urp1 = TestUtils.createUserRolePrivilege("judge", "projScore", "rw");
        rolePrivList.add(urp1);
       
        final UserRolePrivilege urp2 = TestUtils.createUserRolePrivilege("sponsor", "projIdea", "r");
        rolePrivList.add(urp2);
       
        EasyMock.reset( roleDao );
        EasyMock.expect( roleDao.getAllUserRoles() ).andReturn( rolePrivList ).anyTimes();
        EasyMock.replay( roleDao );
View Full Code Here


      csuvo.setUserRoles(userRoles);
     
        //set "mocked" userRolePrivilegedao Object that talks to db layer
        service.setUserRolePrivilegeDao(urpDao);
       
        UserRolePrivilege urp = new UserRolePrivilege();
     
        expect(userDao.findByLoginName(csuvo.getLoginName())).andStubReturn(null);
        expect(urpDao.findRolePrivilege("Student")).andReturn(urp);
        expect(urpDao.findRolePrivilege("")).andReturn(null);
        replay(userDao);
View Full Code Here

        //set "mocked" Objects that talks to db layer
        service.setUserRolePrivilegeDao(urpDao);
        service.setPasswordEncoder(pswdE);
        service.setSeteUserDao(suDao);
       
        UserRolePrivilege urp = new UserRolePrivilege();
     
        expect(userDao.findByLoginName(csuvo.getLoginName())).andStubReturn(null);
        expect(urpDao.findRolePrivilege("Student")).andReturn(urp);
        expect(urpDao.findRolePrivilege("")).andReturn(urp);
        expect(pswdE.encodePassword(csuvo.getPassword(), null)).andStubReturn("sete");
View Full Code Here

    
     */
    @Test
    public void testUpdateSeteUser() {
      expect(userDao.findByLoginName(csuvo.getLoginName())).andStubReturn(testUser);
      expect(urpDao.findRolePrivilege(csuvo.getUserRoles()[0])).andStubReturn(new UserRolePrivilege());
      replay(userDao);
      replay(urpDao);
      service.updateSeteUser(csuvo);
    }
View Full Code Here

        testUser.setFirstName("Johnny");
        testUser.setLastName("Mohseni");
        testUser.setLoginName("Johnny");
        testUser.setPassword("sete");
        Set<UserRolePrivilege> urps = new HashSet<UserRolePrivilege>();
        UserRolePrivilege urp = new UserRolePrivilege();
        urp.setUserRoleType(TypeUtil.forKey(UserRoleType.class, "student"));
        urps.add(urp);
        testUser.setUserRolePrivileges(urps);
              
        //set "mocked" dao Objects that talks to database
        service.setUserDao(userDao);
View Full Code Here

     * @throws IllegalStateException - thrown if any UserRole does not have a defined RolePrivileges.
     */
    private Set<UserRolePrivilege> buildUserRolePrivileges(CreateSeteUserVo vo) {
      //Set User Roles --
      Set<UserRolePrivilege> rolePrivs = new HashSet<UserRolePrivilege>();
      UserRolePrivilege urp = null;
      for(String pk: vo.getUserRoles()){
        urp = userRolePrivilegeDao.findRolePrivilege(pk);
        if(urp != null) {
          rolePrivs.add(urp);
        }
View Full Code Here

        //massage UserPrivilegeType
        /* Contains all sets of Roles privilege/action mappings for User*/
        Set<UserRolePrivilege> rolePrivs = new HashSet<UserRolePrivilege>();

        /* Contains instance of Role and associated privilege/action mapping */
        UserRolePrivilege p = new UserRolePrivilege();

        p.setUserRoleType(TypeUtil.forKey(UserRoleType.class, vo.getUserRole()));

        Set<UserPrivilege> privs = new HashSet<UserPrivilege>();
        UserPrivilege up = null;
        for(String pk: vo.getUserRolePrivileges())
        {
          up = new UserPrivilege();
          up.setUserPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, pk));
          up.setPrivilegeActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ));
          privs.add(up);
        }

        p.setUserPrivileges(privs);

        rolePrivs.add(p);

        su.setUserRolePrivileges(rolePrivs);

View Full Code Here

        ci.setEmailAddress(eaddr);
        ci.setPhoneNumber(pn);
        user.setContactInformation(ci);

        Set<UserRolePrivilege> rolePrivs = new HashSet<UserRolePrivilege>();
        UserRolePrivilege p = new UserRolePrivilege();
        p.setUserRoleType(TypeUtil.forKey(UserRoleType.class, roleKey));

        Set<UserPrivilege> privs = new HashSet<UserPrivilege>();
        UserPrivilege up = null;

        for(String pk : privKeys) {
            up = new UserPrivilege();
            up.setUserPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, pk));
            for(String ak : actionKeys) {
                up.setPrivilegeActionType(TypeUtil.forKey(PrivilegeActionType.class, ak));
            }
            privs.add(up);
        }

        p.setUserPrivileges(privs);
        rolePrivs.add(p);

        user.setUserRolePrivileges(rolePrivs);
        baseDao.saveOrUpdate(user);
    }
View Full Code Here

        testUser.setFirstName("Johnny");
        testUser.setLastName("Mohseni");
        testUser.setLoginName("Johnny");
        testUser.setPassword("sete");
        Set<UserRolePrivilege> urps = new HashSet<UserRolePrivilege>();
        UserRolePrivilege urp = new UserRolePrivilege();
        urp.setUserRoleType(TypeUtil.forKey(UserRoleType.class, "student"));
        urps.add(urp);
        testUser.setUserRolePrivileges(urps);
              
        //set "mocked" dao Object that talks to database
        service.setUserDao(userDao);
View Full Code Here

      csuvo.setUserRoles(userRoles);
     
        //set "mocked" userRolePrivilegedao Object that talks to db layer
        service.setUserRolePrivilegeDao(urpDao);
       
        UserRolePrivilege urp = new UserRolePrivilege();
     
        expect(userDao.findByLoginName(csuvo.getLoginName())).andStubReturn(null);
        expect(urpDao.findRolePrivilege("Student")).andReturn(urp);
        expect(urpDao.findRolePrivilege("")).andReturn(null);
        replay(userDao);
View Full Code Here

TOP

Related Classes of org.sete.domain.UserRolePrivilege

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.