mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix public api tests
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@49008 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user