Package org.hornetq.core.security

Examples of org.hornetq.core.security.Role


      securityManager.addRole("newuser1", "role1");
      securityManager.addRole("newuser1", "role2");
      securityManager.addRole("newuser1", "role3");
      securityManager.addRole("newuser1", "role4");
      HashSet<Role> roles = new HashSet<Role>();
      roles.add(new Role("role1", true, true, true, true, true, true, true));
      Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
      roles = new HashSet<Role>();
      roles.add(new Role("role2", true, true, true, true, true, true, true));
      Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
      roles = new HashSet<Role>();
      roles.add(new Role("role3", true, true, true, true, true, true, true));
      Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
      roles = new HashSet<Role>();
      roles.add(new Role("role4", true, true, true, true, true, true, true));
      Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
      roles = new HashSet<Role>();
      roles.add(new Role("role5", true, true, true, true, true, true, true));
      Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
   }
View Full Code Here


      securityManager.addRole("newuser1", "role3");
      securityManager.addRole("newuser1", "role4");
      securityManager.removeRole("newuser1", "role2");
      securityManager.removeRole("newuser1", "role4");
      HashSet<Role> roles = new HashSet<Role>();
      roles.add(new Role("role1", true, true, true, true, true, true, true));
      Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
      roles = new HashSet<Role>();
      roles.add(new Role("role2", true, true, true, true, true, true, true));
      Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
      roles = new HashSet<Role>();
      roles.add(new Role("role3", true, true, true, true, true, true, true));
      Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
      roles = new HashSet<Role>();
      roles.add(new Role("role4", true, true, true, true, true, true, true));
      Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
      roles = new HashSet<Role>();
      roles.add(new Role("role5", true, true, true, true, true, true, true));
      Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND));
   }
View Full Code Here

      {
         server.start();
         HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         Role role = new Role("arole", false, false, true, false, false, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(role);
         securityRepository.addMatch(SecurityTest.addressA, roles);
         securityManager.addRole("auser", "arole");
         locator.setBlockOnNonDurableSend(true);
View Full Code Here

      {
         server.start();
         HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         Role role = new Role("arole", false, false, true, false, false, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(role);
         securityRepository.addMatch(SecurityTest.addressA, roles);
         securityManager.addRole("auser", "arole");
         ClientSessionFactory cf = locator.createSessionFactory();
View Full Code Here

         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         securityManager.addUser("guest", "guest");
         securityManager.addRole("guest", "guest");
         securityManager.setDefaultUser("guest");
         Role role = new Role("arole", false, true, false, false, false, false, false);
         Role sendRole = new Role("guest", true, false, true, false, false, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(sendRole);
         roles.add(role);
         securityRepository.addMatch(SecurityTest.addressA, roles);
         securityManager.addRole("auser", "arole");
View Full Code Here

         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         securityManager.addUser("guest", "guest");
         securityManager.addRole("guest", "guest");
         securityManager.setDefaultUser("guest");
         Role role = new Role("arole", false, false, false, false, false, false, false);
         Role sendRole = new Role("guest", true, false, true, false, false, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(sendRole);
         roles.add(role);
         securityRepository.addMatch(SecurityTest.addressA, roles);
         securityManager.addRole("auser", "arole");
View Full Code Here

         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         securityManager.addUser("guest", "guest");
         securityManager.addRole("guest", "guest");
         securityManager.setDefaultUser("guest");
         Role role = new Role("arole", false, false, false, false, false, false, false);
         Role sendRole = new Role("guest", true, false, true, false, false, false, false);
         Role receiveRole = new Role("receiver", false, true, false, false, false, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(sendRole);
         roles.add(role);
         roles.add(receiveRole);
         securityRepository.addMatch(SecurityTest.addressA, roles);
View Full Code Here

         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         securityManager.addUser("guest", "guest");
         securityManager.addRole("guest", "guest");
         securityManager.setDefaultUser("guest");
         Role role = new Role("arole", false, false, false, false, false, false, false);
         Role sendRole = new Role("guest", true, false, true, false, false, false, false);
         Role receiveRole = new Role("receiver", false, true, false, false, false, false, false);
         Set<Role> roles = new HashSet<Role>();
         roles.add(sendRole);
         roles.add(role);
         roles.add(receiveRole);
         securityRepository.addMatch(SecurityTest.addressA, roles);
View Full Code Here

         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         securityManager.addUser("guest", "guest");
         securityManager.addRole("guest", "guest");
         securityManager.setDefaultUser("guest");
         Role role = new Role("arole", false, false, false, false, false, false, false);
         System.out.println("guest:" + role);
         Role sendRole = new Role("guest", true, false, true, false, false, false, false);
         System.out.println("guest:" + sendRole);
         Role receiveRole = new Role("receiver", false, true, false, false, false, false, false);
         System.out.println("guest:" + receiveRole);
         Set<Role> roles = new HashSet<Role>();
         roles.add(sendRole);
         roles.add(role);
         roles.add(receiveRole);
View Full Code Here

      {
         server.start();
         HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         Role role = new Role("arole", false, false, false, false, false, false, true);
         Set<Role> roles = new HashSet<Role>();
         roles.add(role);
         securityRepository.addMatch(configuration.getManagementAddress().toString(), roles);
         securityManager.addRole("auser", "arole");
         locator.setBlockOnNonDurableSend(true);
View Full Code Here

TOP

Related Classes of org.hornetq.core.security.Role

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.