Package org.sete.vo.admin

Examples of org.sete.vo.admin.RolePrivilegeVo


        {
            urvo.setUserRole( "student" );
           
            final List<RolePrivilegeVo> rpVos = new ArrayList<RolePrivilegeVo>(1);
            {
                final RolePrivilegeVo rpVo = new RolePrivilegeVo();
                rpVo.setUserRolePrivilege("manageMyProject");
                rpVo.setPrivilegeActions("r");
                rpVos.add(rpVo);
            }
           
            urvo.setUserRolePrivileges(rpVos);
        }
View Full Code Here


        {
            urvo.setUserRole( "judge" );
           
            final List<RolePrivilegeVo> rpVos = new ArrayList<RolePrivilegeVo>(1);
            {
                final RolePrivilegeVo rpVo = new RolePrivilegeVo();
                rpVo.setUserRolePrivilege("manageMyProject");
                rpVo.setPrivilegeActions("r");
                rpVos.add(rpVo);
            }
           
            urvo.setUserRolePrivileges(rpVos);
        }
View Full Code Here

        {
            urvo.setUserRole( "judge" );
           
            final List<RolePrivilegeVo> rpVos = new ArrayList<RolePrivilegeVo>(1);
            {
                final RolePrivilegeVo rpVo = new RolePrivilegeVo();
                rpVo.setUserRolePrivilege("manageJudgeResults");
                rpVo.setPrivilegeActions("r");
                rpVos.add(rpVo);
            }
           
            urvo.setUserRolePrivileges(rpVos);
        }
View Full Code Here

        final String[] writeAllowedPrivs = new String[selectedRole.getUserRolePrivileges().size()];
        final Map selPrivMap = new HashMap();
        {
            for(int i = 0; i < selectedRole.getUserRolePrivileges().size(); i++)
            {
                final RolePrivilegeVo rpvo = selectedRole.getUserRolePrivileges().get(i);
                selPrivs[i] = rpvo.getUserRolePrivilege();
                selPrivMap.put(rpvo.getUserRolePrivilege(), "true");
               
                if(PrivilegeActionType.Key.READ_WRITE_KEY.equals(rpvo.getPrivilegeActions())) {
                    writeAllowedPrivs[i] = rpvo.getUserRolePrivilege();
                }
            }
        }

            //prepare also the read-only list which covers all privileges
View Full Code Here

            urvo.setUserRole( ((ModifyRoleForm)form).getUserRole() );
           
            final List<RolePrivilegeVo> rolePrivList = new ArrayList<RolePrivilegeVo>();
            for(final String assignedPrivKey: ((ModifyRoleForm)form).getUserRolePrivileges())
            {
               final RolePrivilegeVo rpvo = new RolePrivilegeVo();
               rpvo.setUserRolePrivilege( assignedPrivKey );
              
               boolean writeAllowed = false;
               for(final String writeAllowedPrivKey: ((ModifyRoleForm)form).getPrivilegesWithWriteAllowed())
               {
                   if( assignedPrivKey.equals(writeAllowedPrivKey) )
                   {
                       writeAllowed = true;
                       break;
                   }
               }
              
               rpvo.setPrivilegeActions( writeAllowed ? PrivilegeActionType.Key.READ_WRITE_KEY.getKey() : PrivilegeActionType.Key.READ_KEY.getKey());
              
               rolePrivList.add( rpvo );
            }
           
            urvo.setUserRolePrivileges(rolePrivList);
View Full Code Here

                // do role privileges
            final List<RolePrivilegeVo> rolePrivs = new ArrayList<RolePrivilegeVo>();
            for(UserPrivilege up: urp.getUserPrivileges())
            {
                final RolePrivilegeVo rpvo = new RolePrivilegeVo();
                rpvo.setUserRolePrivilege(up.getUserPrivilegeType().getKey());
                rpvo.setPrivilegeActions(up.getPrivilegeActionType().getKey());
                rolePrivs.add(rpvo);
            }

            uro.setUserRolePrivileges(rolePrivs);
View Full Code Here

        final String[] writeAllowedPrivs = new String[selectedRole.getUserRolePrivileges().size()];
        final Map selPrivMap = new HashMap();
        {
            for(int i = 0; i < selectedRole.getUserRolePrivileges().size(); i++)
            {
                final RolePrivilegeVo rpvo = selectedRole.getUserRolePrivileges().get(i);
                selPrivs[i] = rpvo.getUserRolePrivilege();
                selPrivMap.put(rpvo.getUserRolePrivilege(), "true");
               
                if(PrivilegeActionType.Key.READ_WRITE_KEY.equals(rpvo.getPrivilegeActions())) {
                    writeAllowedPrivs[i] = rpvo.getUserRolePrivilege();
                }
            }
        }

            //prepare also the read-only list which covers all privileges
View Full Code Here

            urvo.setUserRole( ((ModifyRoleForm)form).getUserRole() );
           
            final List<RolePrivilegeVo> rolePrivList = new ArrayList<RolePrivilegeVo>();
            for(final String assignedPrivKey: ((ModifyRoleForm)form).getUserRolePrivileges())
            {
               final RolePrivilegeVo rpvo = new RolePrivilegeVo();
               rpvo.setUserRolePrivilege( assignedPrivKey );
              
               boolean writeAllowed = false;
               for(final String writeAllowedPrivKey: ((ModifyRoleForm)form).getPrivilegesWithWriteAllowed())
               {
                   if( assignedPrivKey.equals(writeAllowedPrivKey) )
                   {
                       writeAllowed = true;
                       break;
                   }
               }
              
               rpvo.setPrivilegeActions( writeAllowed ? PrivilegeActionType.Key.READ_WRITE_KEY.getKey() : PrivilegeActionType.Key.READ_KEY.getKey());
              
               rolePrivList.add( rpvo );
            }
           
            urvo.setUserRolePrivileges(rolePrivList);
View Full Code Here

        final UserRoleVo roleVo = roleVos.get(0);
        assertTrue( "judge".equals(roleVo.getUserRole()) );
       
        //there is only one privilege
        assertTrue( null != roleVo.getUserRolePrivileges() && 1 == roleVo.getUserRolePrivileges().size() );
        final RolePrivilegeVo rpVo = roleVo.getUserRolePrivileges().get(0);
       
        //the privilege is "projScore" and it has "rw" allowed action
        assertTrue( "projScore".equals(rpVo.getUserRolePrivilege())  );
        assertTrue( "rw".equals(rpVo.getPrivilegeActions()) );
    }
View Full Code Here

            final UserRoleVo roleVo = roleVos.get(0);
            assertTrue( "judge".equals(roleVo.getUserRole()) );
           
            //there is only one privilege
            assertTrue( null != roleVo.getUserRolePrivileges() && 1 == roleVo.getUserRolePrivileges().size() );
            final RolePrivilegeVo rpVo = roleVo.getUserRolePrivileges().get(0);
           
            //the privilege is "projScore" and it has "rw" allowed action
            assertTrue( "projScore".equals(rpVo.getUserRolePrivilege())  );
            assertTrue( "rw".equals(rpVo.getPrivilegeActions()) );
        }
       
        //user role 2 test
        {
            //the user role is "sponsor"
            final UserRoleVo roleVo = roleVos.get(1);
            assertTrue( "sponsor".equals(roleVo.getUserRole()) );
           
            //there is only one privilege
            assertTrue( null != roleVo.getUserRolePrivileges() && 1 == roleVo.getUserRolePrivileges().size() );
            final RolePrivilegeVo rpVo = roleVo.getUserRolePrivileges().get(0);
           
            //the privilege is "projIdea" and it has "r" allowed action
            assertTrue( "projIdea".equals(rpVo.getUserRolePrivilege())  );
            assertTrue( "r".equals(rpVo.getPrivilegeActions()) );
        }
    }
View Full Code Here

TOP

Related Classes of org.sete.vo.admin.RolePrivilegeVo

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.