diff --git a/source/java/org/alfresco/repo/web/scripts/bean/ADMRemoteStore.java b/source/java/org/alfresco/repo/web/scripts/bean/ADMRemoteStore.java index 3dc474799b..66213fca96 100644 --- a/source/java/org/alfresco/repo/web/scripts/bean/ADMRemoteStore.java +++ b/source/java/org/alfresco/repo/web/scripts/bean/ADMRemoteStore.java @@ -77,6 +77,7 @@ public class ADMRemoteStore extends BaseRemoteStore { private static final Log logger = LogFactory.getLog(ADMRemoteStore.class); + // name of the surf config folder private static final String SURF_CONFIG = "surf-config"; // patterns used to match site and user specific configuration locations @@ -85,6 +86,7 @@ public class ADMRemoteStore extends BaseRemoteStore private static final Pattern SITE_PATTERN_1 = Pattern.compile(".*/components/.*\\.site~(.*)~.*"); private static final Pattern SITE_PATTERN_2 = Pattern.compile(".*/pages/site/(.*?)(/.*)?$"); + // service beans private NodeService nodeService; private NodeService unprotNodeService; private FileFolderService fileFolderService; @@ -143,10 +145,9 @@ public class ADMRemoteStore extends BaseRemoteStore /** * Gets the last modified timestamp for the document. - * + *
* The output will be the last modified date as a long toString(). * - * @param store the store id * @param path document path to an existing document */ @Override @@ -177,17 +178,14 @@ public class ADMRemoteStore extends BaseRemoteStore /** * Gets a document. - * + *
* The output will be the document content stream.
*
- * @param store the store id
* @param path document path
*/
@Override
protected void getDocument(final WebScriptResponse res, final String store, final String path)
{
- // TODO: could only allow appropriate users to read config docs i.e. site specific...
- // but currently GET requests need to run unauthenticated before user login occurs.
AuthenticationUtil.runAs(new RunAsWork
- * Delete methods are user authenticated, so the deletion of site config must be
+ * Delete methods are user authenticated, so the deletion of the document must be
* allowed for the current user.
*
- * @param store the store id
* @param path document path
*/
@Override
@@ -402,9 +401,16 @@ public class ADMRemoteStore extends BaseRemoteStore
return;
}
- this.nodeService.deleteNode(fileInfo.getNodeRef());
- if (logger.isDebugEnabled())
- logger.debug("deleteDocument: " + fileInfo.toString());
+ try
+ {
+ this.nodeService.deleteNode(fileInfo.getNodeRef());
+ if (logger.isDebugEnabled())
+ logger.debug("deleteDocument: " + fileInfo.toString());
+ }
+ catch (AccessDeniedException ae)
+ {
+ res.setStatus(Status.STATUS_UNAUTHORIZED);
+ }
}
/**
@@ -413,7 +419,6 @@ public class ADMRemoteStore extends BaseRemoteStore
* The output will be the list of relative document paths found under the path.
* Separated by newline characters.
*
- * @param store the store id
* @param path document path
* @param recurse true to peform a recursive list, false for direct children only.
*
@@ -461,7 +466,6 @@ public class ADMRemoteStore extends BaseRemoteStore
* The output will be the list of relative document paths found under the path that
* match the given file pattern. Separated by newline characters.
*
- * @param store the store id
* @param path document path
* @param pattern file pattern to match - allows wildcards e.g. page.*.site.xml
*