diff --git a/source/java/org/alfresco/repo/preference/PreferenceServiceImpl.java b/source/java/org/alfresco/repo/preference/PreferenceServiceImpl.java index 83dfd39973..c7b36721e1 100644 --- a/source/java/org/alfresco/repo/preference/PreferenceServiceImpl.java +++ b/source/java/org/alfresco/repo/preference/PreferenceServiceImpl.java @@ -39,6 +39,7 @@ import org.alfresco.repo.content.MimetypeMap; import org.alfresco.repo.security.authentication.AuthenticationContext; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; +import org.alfresco.repo.security.permissions.AccessDeniedException; import org.alfresco.service.cmr.preference.PreferenceService; import org.alfresco.service.cmr.repository.ContentReader; import org.alfresco.service.cmr.repository.ContentService; @@ -205,7 +206,7 @@ public class PreferenceServiceImpl implements PreferenceService { // The current user does not have sufficient permissions to get // the preferences for this user - throw new UnauthorizedAccessException("The current user " + currentUserName + throw new AccessDeniedException("The current user " + currentUserName + " does not have sufficient permissions to get the preferences of the user " + userName); } @@ -391,7 +392,7 @@ public class PreferenceServiceImpl implements PreferenceService { // The current user does not have sufficient permissions to update // the preferences for this user - throw new UnauthorizedAccessException("The current user " + AuthenticationUtil.getFullyAuthenticatedUser() + throw new AccessDeniedException("The current user " + AuthenticationUtil.getFullyAuthenticatedUser() + " does not have sufficient permissions to update the preferences of the user " + userName); } } @@ -481,7 +482,7 @@ public class PreferenceServiceImpl implements PreferenceService { // The current user does not have sufficient permissions to update // the preferences for this user - throw new UnauthorizedAccessException("The current user " + AuthenticationUtil.getFullyAuthenticatedUser() + throw new AccessDeniedException("The current user " + AuthenticationUtil.getFullyAuthenticatedUser() + " does not have sufficient permissions to update the preferences of the user " + userName); } } diff --git a/source/java/org/alfresco/repo/preference/UnauthorizedAccessException.java b/source/java/org/alfresco/repo/preference/UnauthorizedAccessException.java deleted file mode 100644 index f43a1dd2db..0000000000 --- a/source/java/org/alfresco/repo/preference/UnauthorizedAccessException.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2005-2012 Alfresco Software Limited. - * - * This file is part of Alfresco - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ -package org.alfresco.repo.preference; - -import org.alfresco.error.AlfrescoRuntimeException; - -/** - * Runtime exception thrown if the user is not authorized to read, write or - * remove other user's data. - * - * @author Jamal Kaabi-Mofrad - */ -public class UnauthorizedAccessException extends AlfrescoRuntimeException -{ - /** - * Serial version UID - */ - private static final long serialVersionUID = -546260299439699139L; - - /** - * Constructor - * - * @param msgId message id - */ - public UnauthorizedAccessException(String msgId) - { - super(msgId); - } - - /** - * Constructor - * - * @param msgId message id - * @param msgParams message params - */ - public UnauthorizedAccessException(String msgId, Object[] msgParams) - { - super(msgId, msgParams); - } - - /** - * Constructor - * - * @param msgId message id - * @param cause causing exception - */ - public UnauthorizedAccessException(String msgId, Throwable cause) - { - super(msgId, cause); - } - - /** - * Constructor - * - * @param msgId message id - * @param msgParams message params - * @param cause causing exception - */ - public UnauthorizedAccessException(String msgId, Object[] msgParams, Throwable cause) - { - super(msgId, msgParams, cause); - } -}