mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +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,18 +5,14 @@ function main()
|
||||
|
||||
// Get the person who has that user name
|
||||
var person = people.getPerson(userName);
|
||||
|
||||
if (person != null)
|
||||
{
|
||||
// Pass the person to the template
|
||||
model.person = person;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Return 404 - Not Found
|
||||
status.setCode(status.STATUS_NOT_FOUND, "Person " + userName + " does not exist");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
main();
|
@@ -6,35 +6,35 @@
|
||||
<#if person.assocs["cm:avatar"]??>
|
||||
"avatar" : "${"api/node/" + person.assocs["cm:avatar"][0].nodeRef?string?replace('://','/') + "/content/thumbnails/avatar"}",
|
||||
</#if>
|
||||
<#if person.properties.title??>
|
||||
"title" : "${person.properties.title}",
|
||||
<#else>
|
||||
"title" : null,
|
||||
</#if>
|
||||
<#if person.properties.firstName??>
|
||||
"firstName" : "${person.properties.firstName}",
|
||||
"firstName" : "${person.properties.firstName}",
|
||||
<#else>
|
||||
"firstName" : null,
|
||||
"firstName" : null,
|
||||
</#if>
|
||||
<#if person.properties.lastName??>
|
||||
"lastName" : "${person.properties.lastName}",
|
||||
"lastName" : "${person.properties.lastName}",
|
||||
<#else>
|
||||
"lastName" : null,
|
||||
"lastName" : null,
|
||||
</#if>
|
||||
<#if person.properties.title??>
|
||||
"title" : "${person.properties.title}",
|
||||
<#else>
|
||||
"title" : null,
|
||||
</#if>
|
||||
<#if person.properties.organization??>
|
||||
"organisation" : "${person.properties.organization}",
|
||||
"organisation" : "${person.properties.organization}",
|
||||
<#else>
|
||||
"organisation" : null,
|
||||
"organisation" : null,
|
||||
</#if>
|
||||
<#if person.properties.jobtitle??>
|
||||
"jobtitle" : "${person.properties.jobtitle}",
|
||||
"jobtitle" : "${person.properties.jobtitle}",
|
||||
<#else>
|
||||
"jobtitle" : null,
|
||||
"jobtitle" : null,
|
||||
</#if>
|
||||
<#if person.properties.email??>
|
||||
"email" : "${person.properties.email}"
|
||||
"email" : "${person.properties.email}"
|
||||
<#else>
|
||||
"email" : null
|
||||
"email" : null
|
||||
</#if>
|
||||
}
|
||||
</#escape>
|
||||
|
@@ -1,24 +1,23 @@
|
||||
function main()
|
||||
{
|
||||
// Get the shortname
|
||||
var shortName = url.templateArgs.shortname;
|
||||
|
||||
// Get the site
|
||||
var site = siteService.getSite(shortName);
|
||||
|
||||
if (site == null)
|
||||
{
|
||||
// Return 404
|
||||
status.setCode(404, "Site " + shortName + " does not exist");
|
||||
return;
|
||||
}
|
||||
|
||||
var siteRoles = siteService.listSiteRoles().concat(["None"]);
|
||||
var sitePermissionGroups = site.sitePermissionGroups;
|
||||
sitePermissionGroups["everyone"] = "GROUP_EVERYONE";
|
||||
|
||||
model.siteRoles = siteRoles;
|
||||
model.sitePermissionGroups = sitePermissionGroups;
|
||||
var shortName = url.templateArgs.shortname;
|
||||
|
||||
var site = siteService.getSite(shortName);
|
||||
if (site === null)
|
||||
{
|
||||
// Return 404
|
||||
status.setCode(404, "Site " + shortName + " does not exist");
|
||||
return;
|
||||
}
|
||||
|
||||
// calculate the available "roles" and permissions groups for this site
|
||||
// add the "None" pseudo role
|
||||
var siteRoles = siteService.listSiteRoles().concat(["None"]);
|
||||
var sitePermissionGroups = site.sitePermissionGroups;
|
||||
sitePermissionGroups["everyone"] = "GROUP_EVERYONE";
|
||||
|
||||
model.siteRoles = siteRoles;
|
||||
model.sitePermissionGroups = sitePermissionGroups;
|
||||
}
|
||||
|
||||
main();
|
@@ -9,4 +9,4 @@
|
||||
<#list sitePermissionGroups?keys?sort?reverse as role>"${sitePermissionGroups[role]}"<#if role_has_next>,</#if></#list>
|
||||
]
|
||||
}
|
||||
</#escape>
|
||||
</#escape>
|
@@ -3,9 +3,7 @@
|
||||
const VALID_OPERATIONS =
|
||||
{
|
||||
"set": true,
|
||||
"reset-all": true,
|
||||
"allow-members-collaborate": true,
|
||||
"deny-all": true
|
||||
"reset-all": true
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -41,7 +39,7 @@ function runAction(p_params)
|
||||
return;
|
||||
}
|
||||
|
||||
// Permissions set
|
||||
// Permissions to set
|
||||
var jsonPermissions = getMultipleInputValues("permissions");
|
||||
|
||||
// We need the site node to perform some of the operations
|
||||
@@ -71,7 +69,8 @@ function runAction(p_params)
|
||||
{
|
||||
result.id = fileNode.name;
|
||||
result.type = fileNode.isContainer ? "folder" : "document";
|
||||
// Set the permissions
|
||||
|
||||
// Execute the operation
|
||||
switch (operation)
|
||||
{
|
||||
case "set":
|
||||
@@ -92,14 +91,6 @@ function runAction(p_params)
|
||||
case "reset-all":
|
||||
site.resetAllPermissions(fileNode);
|
||||
break;
|
||||
|
||||
case "allow-members-collaborate":
|
||||
site.allowAllMembersCollaborate(fileNode);
|
||||
break;
|
||||
|
||||
case "deny-all":
|
||||
site.denyAllAccess(fileNode);
|
||||
break;
|
||||
}
|
||||
result.success = true;
|
||||
}
|
||||
@@ -118,4 +109,4 @@ function runAction(p_params)
|
||||
}
|
||||
|
||||
/* Bootstrap action script */
|
||||
main();
|
||||
main();
|
Reference in New Issue
Block a user