mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +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());
|
rootJSONObject.put("originatingLocationPath", originatingLocationPath.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to get the display path.
|
* Helper method to get the display path.
|
||||||
*
|
*
|
||||||
* @param nodeRef node reference
|
* @param nodeRef node reference
|
||||||
* @return String display path
|
* @return String display path
|
||||||
*/
|
*/
|
||||||
@@ -330,43 +330,37 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JSONC
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private JSONObject setRmNodeValues(final NodeRef nodeRef, final boolean useShortQName)
|
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()
|
rmNodeValues.put("unfiledRecordContainer", unfiledRecordContainer.toString());
|
||||||
{
|
rmNodeValues.put("properties", propertiesToJSON(unfiledRecordContainer, nodeService.getProperties(unfiledRecordContainer), useShortQName));
|
||||||
JSONObject rmNodeValues = new JSONObject();
|
QName type = fileFolderService.getFileInfo(unfiledRecordContainer).getType();
|
||||||
|
rmNodeValues.put("type", useShortQName ? type.toPrefixString(namespaceService) : type.toString());
|
||||||
|
}
|
||||||
|
|
||||||
// UI convenience type
|
// Set the indicators array
|
||||||
rmNodeValues.put("uiType", getUIType(nodeRef));
|
setIndicators(rmNodeValues, nodeRef);
|
||||||
|
|
||||||
// Get the 'kind' of the file plan component
|
// Set the actions array
|
||||||
FilePlanComponentKind kind = filePlanService.getFilePlanComponentKind(nodeRef);
|
setActions(rmNodeValues, nodeRef);
|
||||||
rmNodeValues.put("kind", kind.toString());
|
|
||||||
|
return rmNodeValues;
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
Reference in New Issue
Block a user