mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-2191 ("Create Category" and "Manage Permissions" buttons are enabled for user with read-only permissions)
+review RM @rwetherall git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.2.1.x@102636 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -305,10 +305,10 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JSONC
|
||||
rootJSONObject.put("originatingLocationPath", originatingLocationPath.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper method to get the display path.
|
||||
*
|
||||
*
|
||||
* @param nodeRef node reference
|
||||
* @return String display path
|
||||
*/
|
||||
@@ -330,43 +330,37 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JSONC
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private JSONObject setRmNodeValues(final NodeRef nodeRef, final boolean useShortQName)
|
||||
{
|
||||
return AuthenticationUtil.runAsSystem(new RunAsWork<JSONObject>()
|
||||
{
|
||||
JSONObject rmNodeValues = new JSONObject();
|
||||
|
||||
// UI convenience type
|
||||
rmNodeValues.put("uiType", getUIType(nodeRef));
|
||||
|
||||
// Get the 'kind' of the file plan component
|
||||
FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRef);
|
||||
rmNodeValues.put("kind", kind.toString());
|
||||
|
||||
// File plan node reference
|
||||
NodeRef filePlan = filePlanService.getFilePlan(nodeRef);
|
||||
rmNodeValues.put("filePlan", filePlan.toString());
|
||||
|
||||
// Unfiled container node reference
|
||||
NodeRef unfiledRecordContainer = filePlanService.getUnfiledContainer(filePlan);
|
||||
if (unfiledRecordContainer != null)
|
||||
{
|
||||
public JSONObject doWork()
|
||||
{
|
||||
JSONObject rmNodeValues = new JSONObject();
|
||||
rmNodeValues.put("unfiledRecordContainer", unfiledRecordContainer.toString());
|
||||
rmNodeValues.put("properties", propertiesToJSON(unfiledRecordContainer, nodeService.getProperties(unfiledRecordContainer), useShortQName));
|
||||
QName type = fileFolderService.getFileInfo(unfiledRecordContainer).getType();
|
||||
rmNodeValues.put("type", useShortQName ? type.toPrefixString(namespaceService) : type.toString());
|
||||
}
|
||||
|
||||
// UI convenience type
|
||||
rmNodeValues.put("uiType", getUIType(nodeRef));
|
||||
// Set the indicators array
|
||||
setIndicators(rmNodeValues, nodeRef);
|
||||
|
||||
// Get the 'kind' of the file plan component
|
||||
FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRef);
|
||||
rmNodeValues.put("kind", kind.toString());
|
||||
|
||||
// File plan node reference
|
||||
NodeRef filePlan = filePlanService.getFilePlan(nodeRef);
|
||||
rmNodeValues.put("filePlan", filePlan.toString());
|
||||
|
||||
// Unfiled container node reference
|
||||
NodeRef unfiledRecordContainer = filePlanService.getUnfiledContainer(filePlan);
|
||||
if (unfiledRecordContainer != null)
|
||||
{
|
||||
rmNodeValues.put("unfiledRecordContainer", unfiledRecordContainer.toString());
|
||||
rmNodeValues.put("properties", propertiesToJSON(unfiledRecordContainer, nodeService.getProperties(unfiledRecordContainer), useShortQName));
|
||||
QName type = fileFolderService.getFileInfo(unfiledRecordContainer).getType();
|
||||
rmNodeValues.put("type", useShortQName ? type.toPrefixString(namespaceService) : type.toString());
|
||||
}
|
||||
|
||||
// Set the indicators array
|
||||
setIndicators(rmNodeValues, nodeRef);
|
||||
|
||||
// Set the actions array
|
||||
setActions(rmNodeValues, nodeRef);
|
||||
|
||||
return rmNodeValues;
|
||||
}
|
||||
});
|
||||
// Set the actions array
|
||||
setActions(rmNodeValues, nodeRef);
|
||||
|
||||
return rmNodeValues;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
Reference in New Issue
Block a user