Package org.ejbca.core.model.authorization

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


    public void removeEndEntityProfile(String name) throws AuthorizationDeniedException{
     if(authorizedToProfileName(name, true)){   
         endEntityProfileSession.removeEndEntityProfile(administrator, name);
        this.info.endEntityProfilesEdited();
     }else {
        throw new AuthorizationDeniedException("Not authorized to remove end entity profile");
     }
    }
View Full Code Here


    public void renameEndEntityProfile(String oldname, String newname) throws EndEntityProfileExistsException, AuthorizationDeniedException{
     if(authorizedToProfileName(oldname, true)){   
         endEntityProfileSession.renameEndEntityProfile(administrator, oldname,newname);
       this.info.endEntityProfilesEdited();
     }else {
       throw new AuthorizationDeniedException("Not authorized to rename end entity profile");
     }
    }
View Full Code Here

    public void cloneEndEntityProfile(String originalname, String newname) throws EndEntityProfileExistsException, AuthorizationDeniedException{        
      if(authorizedToProfileName(originalname, true)){
          endEntityProfileSession.cloneEndEntityProfile(administrator, originalname,newname);
        this.info.endEntityProfilesEdited();
      }else {
         throw new AuthorizationDeniedException("Not authorized to clone end entity profile");
      }
    }   
View Full Code Here

    }   
   
      /** Method to get a reference to a end entity profile.*/
    public EndEntityProfile getEndEntityProfile(int id) throws AuthorizationDeniedException
      if(!authorizedToProfileId(id, false)) {
        throw new AuthorizationDeniedException("Not authorized to end entity profile: "+id);            
      }
      return endEntityProfileSession.getEndEntityProfile(administrator, id);
    }     
View Full Code Here

      return endEntityProfileSession.getEndEntityProfile(administrator, id);
    }     
         
    public EndEntityProfile getEndEntityProfile(String profilename) throws AuthorizationDeniedException{
     if(!authorizedToProfileName(profilename, false)) {
        throw new AuthorizationDeniedException("Not authorized to end entity profile: "+profilename);           
     }
      return endEntityProfileSession.getEndEntityProfile(administrator, profilename);
    }
View Full Code Here

        if (!authorizationsession.isAuthorizedNoLog(administrator, AccessRulesConstants.REGULAR_EDITADMINISTRATORPRIVILEDGES)) {
            Authorizer.throwAuthorizationException(administrator, AccessRulesConstants.REGULAR_EDITADMINISTRATORPRIVILEDGES, null);
        }
        // Authorized to group
        if (!authorizationsession.isAuthorizedToGroup(administrator, admingroup)) {
            throw new AuthorizationDeniedException("Admin " + administrator + " not authorized to group "
                    + admingroup);
        }
      // Check if admin group is among available admin groups
      boolean exists = false;
      for(AdminGroup next : getAdminGroupNames()) {
        if (next.getAdminGroupName().equals(admingroup)) {
          exists = true;
        }
      }
      if (!exists) {
          if(log.isDebugEnabled()) {
              log.debug("Admingroup " + admingroup + " not among authorized admingroups.");
          }
        throw new AuthorizationDeniedException("Admingroup " + admingroup + " not among authorized admingroups.");
      }
    }
View Full Code Here

   
    private void authorizedToAddAccessRules(Collection<AccessRule> accessrules) throws AuthorizationDeniedException{
      Iterator<AccessRule> iter = accessrules.iterator();
      while (iter.hasNext()) {
        if (!this.informationmemory.getAuthorizedAccessRules().contains(iter.next().getAccessRule())) { 
          throw new AuthorizationDeniedException("Accessruleset contained non authorized access rules");
        }
      }
    }
View Full Code Here

          this.info.hardTokenDataEdited();
          success=true;
     
        
      }else {
        throw new AuthorizationDeniedException("Not authorized to add hard token profile");
      }
      return success;
    }   
View Full Code Here

          hardtokensession.changeHardTokenProfile(administrator, name,profile);  
          this.info.hardTokenDataEdited();
          success=true;
        }
      }else {
        throw new AuthorizationDeniedException("Not authorized to edit hard token profile");
      }
      return success;
    }
View Full Code Here

      if(authorizedToProfileName(name, true)){   
    hardtokensession.removeHardTokenProfile(administrator, name);
    this.info.hardTokenDataEdited();
    returnval = false;
      }else {
        throw new AuthorizationDeniedException("Not authorized to remove hard token profile");
      }
      return returnval;         
    }
View Full Code Here

TOP

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

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.