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:
Kevin Roast
2008-08-29 13:45:34 +00:00
parent 2bc7aa10ef
commit 09e765ff74
5 changed files with 40 additions and 54 deletions

View File

@@ -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;
} }
} }

View File

@@ -6,11 +6,6 @@
<#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>
@@ -21,6 +16,11 @@
<#else> <#else>
"lastName" : null, "lastName" : null,
</#if> </#if>
<#if person.properties.title??>
"title" : "${person.properties.title}",
<#else>
"title" : null,
</#if>
<#if person.properties.organization??> <#if person.properties.organization??>
"organisation" : "${person.properties.organization}", "organisation" : "${person.properties.organization}",
<#else> <#else>

View File

@@ -1,18 +1,17 @@
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)
if (site == null)
{ {
// Return 404 // Return 404
status.setCode(404, "Site " + shortName + " does not exist"); status.setCode(404, "Site " + shortName + " does not exist");
return; return;
} }
// calculate the available "roles" and permissions groups for this site
// add the "None" pseudo role
var siteRoles = siteService.listSiteRoles().concat(["None"]); var siteRoles = siteService.listSiteRoles().concat(["None"]);
var sitePermissionGroups = site.sitePermissionGroups; var sitePermissionGroups = site.sitePermissionGroups;
sitePermissionGroups["everyone"] = "GROUP_EVERYONE"; sitePermissionGroups["everyone"] = "GROUP_EVERYONE";

View File

@@ -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;
} }