Package org.ejbca.core.model.authorization

Examples of org.ejbca.core.model.authorization.AccessRule


        Admin admin = new Admin(Admin.TYPE_CACOMMANDLINE_USER);
        Admin anAdmin = new Admin(getTestCACert(testCaName), testAdminName, null);

        List<AccessRule> accessrules = new ArrayList<AccessRule>();
        accessrules.add(new AccessRule(AccessRulesConstants.CAPREFIX + ("CN=" + testCaName).hashCode(), AccessRule.RULE_ACCEPT, false));

        cleanUpAdminGroupTests(anAdmin, TEST_GROUPNAME, accessrules);
        adminGroupSession.addAdminGroup(anAdmin, TEST_GROUPNAME);

        List<AdminEntity> adminEntities = new ArrayList<AdminEntity>();
View Full Code Here


        createTestCA(testCaName);
        Admin anAdmin = new Admin(getTestCACert(testCaName), testAdminName, null);
        // Do test with external user and an empty group

        List<AccessRule> accessrules = new ArrayList<AccessRule>();
        accessrules.add(new AccessRule(AccessRulesConstants.CAPREFIX + ("CN=SpiderMonkey").hashCode(), AccessRule.RULE_ACCEPT, false));
       
        cleanUpAdminGroupTests(anAdmin, TEST_GROUPNAME, accessrules);
        adminGroupSession.addAdminGroup(anAdmin, TEST_GROUPNAME);
       
        try {
View Full Code Here

        createTestCA(testCaName);

        Admin anAdmin = new Admin(getTestCACert(testCaName), testAdminName, null);

        List<AccessRule> accessrules = new ArrayList<AccessRule>();
        accessrules.add(new AccessRule(AccessRulesConstants.CAPREFIX + ("CN=SpiderMonkey").hashCode(), AccessRule.RULE_ACCEPT, false));

        cleanUpAdminGroupTests(anAdmin, TEST_GROUPNAME, accessrules);
        adminGroupSession.addAdminGroup(anAdmin, TEST_GROUPNAME);

        try {
View Full Code Here

      boolean result = authorizationSession.existsEndEntityProfileInRules(admin, id);
      assertFalse("Id "+id+" exists in access rules, did we generate a real existing id?", result);
      // Add the id to access rules
        try {
            List<AccessRule> accessrules = new ArrayList<AccessRule>();
            accessrules.add(new AccessRule(AccessRulesConstants.ENDENTITYPROFILEPREFIX + id, AccessRule.RULE_ACCEPT, false));
            cleanUpAdminGroupTests(admin, TEST_GROUPNAME, accessrules);
            try {
        adminGroupSession.addAdminGroup(admin, TEST_GROUPNAME);
      } catch (AdminGroupExistsException e) {
        // NOPMD: do nothing
View Full Code Here

       
      Iterator<?> iter = accessrules.iterator();
      while(iter.hasNext()){
        Object obj = iter.next();
        String accessrulestring = "";
        AccessRule accessrule = null;
        if( obj instanceof AccessRule ){
          accessrulestring = ((AccessRule) obj).getAccessRule();
          accessrule = (AccessRule) obj;
        }else{
          accessrulestring = (String) obj;
          accessrule = new AccessRule(accessrulestring, 0false);
       
        boolean regular = true;
       
        // Check if rule is a role based one
        for(int i=0; i< AccessRulesConstants.ROLEACCESSRULES.length; i++){
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.authorization.AccessRule

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.