mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
New implementation of doclibrary fine grained permissions dialog.
- Updated to Linton's new design and visuals - Removal of obsolete actions - SiteManager group permissions can no longer be modified - Removal of unnecessary and naughty runAs(systemuser) code patterns in Site permission modification code - Setting and Resetting of permissions now working correctly - Addition of missing permission checks to doclib actions (fixes issue with apparent ability of a Consumer user able to edit document meta-data - infact they could not, no permission check was performed before rendering the action and cached data was displayed when subsequently clicked) - Various other fixes and improvements to related webscripts. Addition of the SiteContributor role. Fix to missing json encoding in json.status.ftl Minor improvements to url encoder/decoder classes and removal of flush() call from RemoteClient that was not required but occasionally caused issues for Flash apps. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10579 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -5,17 +5,13 @@ function main()
|
|||||||
|
|
||||||
// Get the person who has that user name
|
// Get the person who has that user name
|
||||||
var person = people.getPerson(userName);
|
var person = people.getPerson(userName);
|
||||||
|
|
||||||
if (person != null)
|
if (person != null)
|
||||||
{
|
{
|
||||||
// Pass the person to the template
|
|
||||||
model.person = person;
|
model.person = person;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Return 404 - Not Found
|
|
||||||
status.setCode(status.STATUS_NOT_FOUND, "Person " + userName + " does not exist");
|
status.setCode(status.STATUS_NOT_FOUND, "Person " + userName + " does not exist");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -6,35 +6,35 @@
|
|||||||
<#if person.assocs["cm:avatar"]??>
|
<#if person.assocs["cm:avatar"]??>
|
||||||
"avatar" : "${"api/node/" + person.assocs["cm:avatar"][0].nodeRef?string?replace('://','/') + "/content/thumbnails/avatar"}",
|
"avatar" : "${"api/node/" + person.assocs["cm:avatar"][0].nodeRef?string?replace('://','/') + "/content/thumbnails/avatar"}",
|
||||||
</#if>
|
</#if>
|
||||||
<#if person.properties.title??>
|
|
||||||
"title" : "${person.properties.title}",
|
|
||||||
<#else>
|
|
||||||
"title" : null,
|
|
||||||
</#if>
|
|
||||||
<#if person.properties.firstName??>
|
<#if person.properties.firstName??>
|
||||||
"firstName" : "${person.properties.firstName}",
|
"firstName" : "${person.properties.firstName}",
|
||||||
<#else>
|
<#else>
|
||||||
"firstName" : null,
|
"firstName" : null,
|
||||||
</#if>
|
</#if>
|
||||||
<#if person.properties.lastName??>
|
<#if person.properties.lastName??>
|
||||||
"lastName" : "${person.properties.lastName}",
|
"lastName" : "${person.properties.lastName}",
|
||||||
<#else>
|
<#else>
|
||||||
"lastName" : null,
|
"lastName" : null,
|
||||||
|
</#if>
|
||||||
|
<#if person.properties.title??>
|
||||||
|
"title" : "${person.properties.title}",
|
||||||
|
<#else>
|
||||||
|
"title" : null,
|
||||||
</#if>
|
</#if>
|
||||||
<#if person.properties.organization??>
|
<#if person.properties.organization??>
|
||||||
"organisation" : "${person.properties.organization}",
|
"organisation" : "${person.properties.organization}",
|
||||||
<#else>
|
<#else>
|
||||||
"organisation" : null,
|
"organisation" : null,
|
||||||
</#if>
|
</#if>
|
||||||
<#if person.properties.jobtitle??>
|
<#if person.properties.jobtitle??>
|
||||||
"jobtitle" : "${person.properties.jobtitle}",
|
"jobtitle" : "${person.properties.jobtitle}",
|
||||||
<#else>
|
<#else>
|
||||||
"jobtitle" : null,
|
"jobtitle" : null,
|
||||||
</#if>
|
</#if>
|
||||||
<#if person.properties.email??>
|
<#if person.properties.email??>
|
||||||
"email" : "${person.properties.email}"
|
"email" : "${person.properties.email}"
|
||||||
<#else>
|
<#else>
|
||||||
"email" : null
|
"email" : null
|
||||||
</#if>
|
</#if>
|
||||||
}
|
}
|
||||||
</#escape>
|
</#escape>
|
||||||
|
@@ -1,24 +1,23 @@
|
|||||||
function main()
|
function main()
|
||||||
{
|
{
|
||||||
// Get the shortname
|
var shortName = url.templateArgs.shortname;
|
||||||
var shortName = url.templateArgs.shortname;
|
|
||||||
|
|
||||||
// Get the site
|
var site = siteService.getSite(shortName);
|
||||||
var site = siteService.getSite(shortName);
|
if (site === null)
|
||||||
|
{
|
||||||
|
// Return 404
|
||||||
|
status.setCode(404, "Site " + shortName + " does not exist");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (site == null)
|
// calculate the available "roles" and permissions groups for this site
|
||||||
{
|
// add the "None" pseudo role
|
||||||
// Return 404
|
var siteRoles = siteService.listSiteRoles().concat(["None"]);
|
||||||
status.setCode(404, "Site " + shortName + " does not exist");
|
var sitePermissionGroups = site.sitePermissionGroups;
|
||||||
return;
|
sitePermissionGroups["everyone"] = "GROUP_EVERYONE";
|
||||||
}
|
|
||||||
|
|
||||||
var siteRoles = siteService.listSiteRoles().concat(["None"]);
|
model.siteRoles = siteRoles;
|
||||||
var sitePermissionGroups = site.sitePermissionGroups;
|
model.sitePermissionGroups = sitePermissionGroups;
|
||||||
sitePermissionGroups["everyone"] = "GROUP_EVERYONE";
|
|
||||||
|
|
||||||
model.siteRoles = siteRoles;
|
|
||||||
model.sitePermissionGroups = sitePermissionGroups;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
main();
|
@@ -3,9 +3,7 @@
|
|||||||
const VALID_OPERATIONS =
|
const VALID_OPERATIONS =
|
||||||
{
|
{
|
||||||
"set": true,
|
"set": true,
|
||||||
"reset-all": true,
|
"reset-all": true
|
||||||
"allow-members-collaborate": true,
|
|
||||||
"deny-all": true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,7 +39,7 @@ function runAction(p_params)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Permissions set
|
// Permissions to set
|
||||||
var jsonPermissions = getMultipleInputValues("permissions");
|
var jsonPermissions = getMultipleInputValues("permissions");
|
||||||
|
|
||||||
// We need the site node to perform some of the operations
|
// We need the site node to perform some of the operations
|
||||||
@@ -71,7 +69,8 @@ function runAction(p_params)
|
|||||||
{
|
{
|
||||||
result.id = fileNode.name;
|
result.id = fileNode.name;
|
||||||
result.type = fileNode.isContainer ? "folder" : "document";
|
result.type = fileNode.isContainer ? "folder" : "document";
|
||||||
// Set the permissions
|
|
||||||
|
// Execute the operation
|
||||||
switch (operation)
|
switch (operation)
|
||||||
{
|
{
|
||||||
case "set":
|
case "set":
|
||||||
@@ -92,14 +91,6 @@ function runAction(p_params)
|
|||||||
case "reset-all":
|
case "reset-all":
|
||||||
site.resetAllPermissions(fileNode);
|
site.resetAllPermissions(fileNode);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "allow-members-collaborate":
|
|
||||||
site.allowAllMembersCollaborate(fileNode);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "deny-all":
|
|
||||||
site.denyAllAccess(fileNode);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
result.success = true;
|
result.success = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user