/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsSecurityException(container, cause); } }
/** * @see org.opencms.main.CmsException#createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable) */ @Override public CmsException createException(CmsMessageContainer container, Throwable cause) { return new CmsSecurityException(container, cause); } }
/** * @see org.opencms.security.I_CmsPasswordHandler#validatePassword(java.lang.String) */ public void validatePassword(String password) throws CmsSecurityException { if ((password == null) || (password.length() < PASSWORD_MIN_LENGTH)) { throw new CmsSecurityException( Messages.get().container(Messages.ERR_PASSWORD_TOO_SHORT_1, new Integer(PASSWORD_MIN_LENGTH))); } } }
/** * @see org.opencms.security.I_CmsPasswordHandler#validatePassword(java.lang.String) */ public void validatePassword(String password) throws CmsSecurityException { if ((password == null) || (password.length() < PASSWORD_MIN_LENGTH)) { throw new CmsSecurityException(Messages.get().container( Messages.ERR_PASSWORD_TOO_SHORT_1, new Integer(PASSWORD_MIN_LENGTH))); } } }
/** * Validates (translates) the given path and checks if it is filtered out.<p> * * @param path the path to validate * * @return the validated path * * @throws CmsSecurityException if the path is filtered out */ private String validatePath(String path) throws CmsSecurityException { // Problems with spaces in new folders (default: "Neuer Ordner") // Solution: translate this to a correct name. String ret = m_cms.getRequestContext().getFileTranslator().translateResource(path); // add site root only works correct if system folder ends with a slash if (CmsResource.VFS_FOLDER_SYSTEM.equals(ret)) { ret = ret.concat("/"); } // filter path if (isFiltered(ret)) { throw new CmsSecurityException(Messages.get().container(Messages.ERR_ITEM_FILTERED_1, path)); } return ret; } }
/** * Validates (translates) the given path and checks if it is filtered out.<p> * * @param path the path to validate * * @return the validated path * * @throws CmsSecurityException if the path is filtered out */ private String validatePath(String path) throws CmsSecurityException { // Problems with spaces in new folders (default: "Neuer Ordner") // Solution: translate this to a correct name. String ret = m_cms.getRequestContext().getFileTranslator().translateResource(path); // add site root only works correct if system folder ends with a slash if (CmsResource.VFS_FOLDER_SYSTEM.equals(ret)) { ret = ret.concat("/"); } // filter path if (isFiltered(ret)) { throw new CmsSecurityException(Messages.get().container(Messages.ERR_ITEM_FILTERED_1, path)); } return ret; } }
new CmsSecurityException( Messages.get().container( Messages.ERR_DIRECT_PUBLISH_NO_PERMISSIONS_1,
/** * Aborts the given publish job.<p> * * @param cms the cms context * @param publishJob the publish job to abort * @param removeJob indicates if the job will be removed or added to history * * @throws CmsException if there is some problem during unlocking the resources * @throws CmsSecurityException if the current user has not enough permissions * @throws CmsPublishException if the publish job can not been aborted */ public void abortPublishJob(CmsObject cms, CmsPublishJobEnqueued publishJob, boolean removeJob) throws CmsException, CmsSecurityException, CmsPublishException { if (!OpenCms.getRoleManager().hasRole(cms, CmsRole.PROJECT_MANAGER) && !cms.getRequestContext().currentUser().getId().equals(publishJob.getUserId())) { // Can only be executed by somebody with the role CmsRole#PROJECT_MANAGER or the owner of the job throw new CmsSecurityException(Messages.get().container( Messages.ERR_PUBLISH_ENGINE_ABORT_DENIED_1, cms.getRequestContext().currentUser().getName())); } m_publishEngine.abortPublishJob(cms.getRequestContext().currentUser().getId(), publishJob, removeJob); }
permissionIssues.addException(new CmsSecurityException(Messages.get().container( Messages.ERR_DIRECT_PUBLISH_NO_PERMISSIONS_1, dbc.removeSiteRoot(res.getRootPath()))));
/** * Aborts the given publish job.<p> * * @param cms the cms context * @param publishJob the publish job to abort * @param removeJob indicates if the job will be removed or added to history * * @throws CmsException if there is some problem during unlocking the resources * @throws CmsSecurityException if the current user has not enough permissions * @throws CmsPublishException if the publish job can not been aborted */ public void abortPublishJob(CmsObject cms, CmsPublishJobEnqueued publishJob, boolean removeJob) throws CmsException, CmsSecurityException, CmsPublishException { if (!OpenCms.getRoleManager().hasRole(cms, CmsRole.PROJECT_MANAGER) && !cms.getRequestContext().getCurrentUser().getId().equals(publishJob.getUserId())) { // Can only be executed by somebody with the role CmsRole#PROJECT_MANAGER or the owner of the job throw new CmsSecurityException( Messages.get().container( Messages.ERR_PUBLISH_ENGINE_ABORT_DENIED_1, cms.getRequestContext().getCurrentUser().getName())); } m_publishEngine.abortPublishJob(cms.getRequestContext().getCurrentUser().getId(), publishJob, removeJob); }
throw new CmsSecurityException(Messages.get().container(Messages.ERR_DELETE_ROLE_GROUP_1, name));
throw new CmsSecurityException(Messages.get().container(Messages.ERR_DELETE_ROLE_GROUP_1, name));
throw new CmsSecurityException(org.opencms.security.Messages.get().container( org.opencms.security.Messages.ERR_CANT_DELETE_DEFAULT_USER_1, user.getName())); throw new CmsSecurityException(Messages.get().container(Messages.ERR_USER_CANT_DELETE_ITSELF_USER_0));
throw new CmsSecurityException( org.opencms.security.Messages.get().container( org.opencms.security.Messages.ERR_CANT_DELETE_DEFAULT_USER_1, throw new CmsSecurityException(Messages.get().container(Messages.ERR_USER_CANT_DELETE_ITSELF_USER_0));
throw new CmsSecurityException(Messages.get().container(Messages.ERR_DELETE_ROLE_GROUP_1, group.getName()));
throw new CmsSecurityException(Messages.get().container(Messages.ERR_DELETE_ROLE_GROUP_1, group.getName()));
throw new CmsSecurityException( Messages.get().container(Messages.ERR_PROJECT_NOT_ACCESSIBLE_2, userName, projectName)); throw new CmsSecurityException( Messages.get().container(Messages.ERR_SITE_NOT_ACCESSIBLE_2, userName, siteRoot));
throw new CmsSecurityException(Messages.get().container( Messages.ERR_PROJECT_NOT_ACCESSIBLE_2, userName, throw new CmsSecurityException(Messages.get().container( Messages.ERR_SITE_NOT_ACCESSIBLE_2, userName,
throw new CmsSecurityException(Messages.get().container(Messages.ERR_NO_WORKPLACE_PERMISSIONS_0));
throw new CmsSecurityException(Messages.get().container(Messages.ERR_NO_WORKPLACE_PERMISSIONS_0));