Package org.ejbca.core.model.authorization

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


    public void renameHardTokenProfile(String oldname, String newname) throws HardTokenProfileExistsException, AuthorizationDeniedException{
     if(authorizedToProfileName(oldname, true)){   
    hardtokensession.renameHardTokenProfile(administrator, oldname,newname);
     this.info.hardTokenDataEdited();
     }else {
       throw new AuthorizationDeniedException("Not authorized to rename hard token profile");
     }
    }
View Full Code Here


    public void cloneHardTokenProfile(String originalname, String newname) throws HardTokenProfileExistsException, AuthorizationDeniedException{        
      if(authorizedToProfileName(originalname, false)){
        hardtokensession.cloneHardTokenProfile(administrator, originalname,newname);
        this.info.hardTokenDataEdited();
      }else {
         throw new AuthorizationDeniedException("Not authorized to clone hard token profile");
      }
    }       
View Full Code Here


      /** Method to get a reference to a Hard Token profile.*/
    public HardTokenProfile getHardTokenProfile(int id) throws AuthorizationDeniedException{
      if(!authorizedToProfileId(id, false)) {
        throw new AuthorizationDeniedException("Not authorized to hard token profile");           
      }
      return hardtokensession.getHardTokenProfile(administrator, id);
    }     
View Full Code Here

      return hardtokensession.getHardTokenProfile(administrator, id);
    }     
         
    public HardTokenProfile getHardTokenProfile(String profilename) throws AuthorizationDeniedException{
     if(!authorizedToProfileName(profilename, false)) {
        throw new AuthorizationDeniedException("Not authorized to hard token profile");           
     }
      return hardtokensession.getHardTokenProfile(administrator, profilename);
    }
View Full Code Here

      }

      try {
        isAuthorized(URLDecoder.decode(resource,"UTF-8"));
      } catch(AuthorizationDeniedException e) {
        throw new AuthorizationDeniedException("You are not authorized to view this page.");
      } catch( EJBException e) {
          final Throwable cause = e.getCause();
          final String dbProblemMessage = getText("DATABASEDOWN");
          if ( cause instanceof SQLException ) {
              final Exception e1 = new Exception(dbProblemMessage);
View Full Code Here

     * @throws AuthorizationDeniedException is not authorized to resource
     */
    public boolean isAuthorized(String resource) throws AuthorizationDeniedException {
        if (certificates != null) {
            if (!authorizationSession.isAuthorized(administrator, resource)) {
            throw new  AuthorizationDeniedException("Not authorized to "+resource);
            }
        } else {
            throw new AuthorizationDeniedException("Client certificate required.");
        }
        return true;
    }
View Full Code Here

     * @throws AuthorizationDeniedException is not authorized to resource
     */
    public boolean isAuthorizedNoLog(String resource) throws AuthorizationDeniedException {
      if(certificates != null){
        if (!authorizationSession.isAuthorizedNoLog(administrator,resource)) {
            throw new  AuthorizationDeniedException("Not authorized to "+resource);         
        }
      } else{
        throw new  AuthorizationDeniedException("Client certificate required");
      }
      return true;
    }
View Full Code Here

          // We don't bother to lookup the admin's username and email for this check..
          raauthorized[resource] = Boolean.valueOf(authorizationSession.isAuthorizedNoLog(new Admin(certificates[0], null, null),AUTHORIZED_RA_RESOURCES[resource]));
        }
        returnval = raauthorized[resource].booleanValue();
      } else{
        throw new  AuthorizationDeniedException("Client certificate required.");
      }
      if (!returnval) {
        throw new  AuthorizationDeniedException("Not authorized to "+resource);
      }
      return returnval;
    }
View Full Code Here

    public void addCertificateProfile(String name, CertificateProfile profile) throws CertificateProfileExistsException, AuthorizationDeniedException {
        if (authorizedToProfile(profile, true)) {
            certificateProfileSession.addCertificateProfile(administrator, name, profile);
            this.info.certificateProfilesEdited();
        } else {
            throw new AuthorizationDeniedException("Not authorized to add certificate profile");
        }
    }
View Full Code Here

    public void changeCertificateProfile(String name, CertificateProfile profile) throws AuthorizationDeniedException {
        if (authorizedToProfile(profile, true)) {
            certificateProfileSession.changeCertificateProfile(administrator, name, profile);
            this.info.certificateProfilesEdited();
        } else {
            throw new AuthorizationDeniedException("Not authorized to edit certificate profile");
        }
    }
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.