mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-1822 (Non-system-admin user not allowed to read inheritable permissions)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@93334 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<webscript>
|
||||
<shortname>permissions</shortname>
|
||||
<description>Document List Component - permissions data webscript</description>
|
||||
<url>/slingshot/doclib/rm/permissions/{store_type}/{store_id}/{id}</url>
|
||||
<format default="json">argument</format>
|
||||
<authentication>user</authentication>
|
||||
<transaction allow="readonly">required</transaction>
|
||||
<lifecycle>internal</lifecycle>
|
||||
</webscript>
|
@@ -0,0 +1,42 @@
|
||||
<import resource="classpath:/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/permissions.get.js">
|
||||
|
||||
function getRmPermissions()
|
||||
{
|
||||
/**
|
||||
* nodeRef input: store_type, store_id and id
|
||||
*/
|
||||
var storeType = url.templateArgs.store_type,
|
||||
storeId = url.templateArgs.store_id,
|
||||
id = url.templateArgs.id,
|
||||
nodeRef = storeType + "://" + storeId + "/" + id,
|
||||
node = ParseArgs.resolveNode(nodeRef);
|
||||
|
||||
if (node == null)
|
||||
{
|
||||
node = search.findNode(nodeRef);
|
||||
if (node === null)
|
||||
{
|
||||
status.setCode(status.STATUS_NOT_FOUND, "Not a valid nodeRef: '" + nodeRef + "'");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
var permissionData = model.data,
|
||||
settable = node.getSettablePermissions(),
|
||||
canReadInherited = true;
|
||||
|
||||
if (node.parent.hasPermission("ReadRecords"))
|
||||
{
|
||||
permissionData["inherited"] = parsePermissions(node.parent.getPermissions(), settable);
|
||||
}
|
||||
else
|
||||
{
|
||||
canReadInherited = false;
|
||||
}
|
||||
|
||||
permissionData["canReadInherited"] = canReadInherited;
|
||||
|
||||
model.data = permissionData;
|
||||
}
|
||||
|
||||
getRmPermissions();
|
@@ -0,0 +1 @@
|
||||
<#include "permissions.get.json.ftl">
|
Reference in New Issue
Block a user