Package org.hornetq.core.security

Examples of org.hornetq.core.security.Role


      {
         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


      {
         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, 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

      {
         server.start();
         HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
         HornetQSecurityManager securityManager = server.getSecurityManager();
         securityManager.addUser("auser", "pass");
         Role role = new Role("arole", false, false, true, true, 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

      {
         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

      {
         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, true, 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

      {
         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, 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

      {
         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, true, true, 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

      {
         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, true, 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");
        
         Role role = new Role("arole", true, true, 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);
        
         ClientSessionFactory cf = locator.createSessionFactory();
        
         ClientSession session = cf.createSession("auser", "pass", false, true, true, false, -1);
        
         session.createQueue(SecurityTest.addressA, SecurityTest.queueA, true);
        
         ClientProducer cp = session.createProducer(SecurityTest.addressA);
        
         cp.send(session.createMessage(false));
        
         session.start();
        
         ClientConsumer cons = session.createConsumer(queueA);
        
         ClientMessage receivedMessage = cons.receive(5000);
        
         assertNotNull(receivedMessage);
        
         receivedMessage.acknowledge();
        
         role = new Role("arole", false, false, true, false, false, false, false);
        
         roles = new HashSet<Role>();
        
         roles.add(role);
        
View Full Code Here

      securityManager.addRole("guest", "guest");
      securityManager.setDefaultUser("guest");
      Assert.assertTrue(securityManager.validateUser(null, null));
      Assert.assertTrue(securityManager.validateUser("guest", "guest"));
      HashSet<Role> roles = new HashSet<Role>();
      roles.add(new Role("guest", true, true, true, true, true, true, true));
      Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.CREATE_DURABLE_QUEUE));
      Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.SEND));
      Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.CONSUME));
      roles = new HashSet<Role>();
      roles.add(new Role("guest", true, true, false, true, true, true, true));
      Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CREATE_DURABLE_QUEUE));
      Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.SEND));
      Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.CONSUME));
      roles = new HashSet<Role>();
      roles.add(new Role("guest", true, false, false, true, true, true, true));
      Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CREATE_DURABLE_QUEUE));
      Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.SEND));
      Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CONSUME));
      roles = new HashSet<Role>();
      roles.add(new Role("guest", false, false, false, true, true, true, true));
      Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CREATE_DURABLE_QUEUE));
      Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.SEND));
      Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CONSUME));
   }
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.