01-08-2010 01:42 AM
folder = search.findNode(args.nodeRef);
if(folder != null)
{
// if(folder.permissions != null)
if(folder.hasPermission("_ReadPermissions") == true);
{
for each (var record in folder.permissions) //This is the line that fails. I have also tried using folder.getPermissions(); with the same result.
{
record = "GROUP_FOF_Approvers";
fields = record.split(";");
var group = fields[1];
if (/^GROUP_(.*?)Approvers?$/i.test(group))
{
for each (approver in people.getMembers(people.getGroup(group)))
{
if(person.properties.userName == approver.properties.userName)
{
model.approver = "true";
}
}
}
}
}
}
folder.getMembers('*');
folder.getGroup(); // Errors
folder.properties['cm:group'];
folder.search('cm:group'); // Errors
search.luceneSearch('+@cm\\:Group:"GROUP_FOF_Approvers"'); //Returns no matches.
folder.hasPermission("ReadPermissions"); //This works as a test but still errors when I try to access the permissions with a non admin user. _ReadPermissions also works.
AuthorityService.searchGroups(); //AuthorityService does not exist.
AuthorityService.getAllAuthorities(AuthorityType.GROUP); //AuthorityService does not exist.
search.luceneSearch("user://alfrescoUserStore", "TYPE:\"usr:authorityContainer\"") //Cant use usr:authorityContainer
folder.getAuthorities;
folder.searchGroups(); //Does not work
groups.searchGroups("*"); //This returns a list of groups but not specific to the folder, only all groups.
folder.permissions; //Works fine for admin but not for any other user.
500 Description: An error inside the HTTP server which prevented it from fulfilling the request.
Exception: org.alfresco.web.scripts.WebScriptException - 00080232 Wrapped Exception (with status template): 00080231 Failed to execute script '/mincom/submitKB/theDocuments.get.js (in repository store workspace://SpacesStore/Company Home/dictionary/Web Scripts)': 00080230 Access Denied. You do not have the appropriate permissions to perform this operation.
org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:613)
Server: Alfresco Community v3.2.0 (@build-number@) schema 2,019
If any one needs the full debug output please let me know, I didn't want to flood the page.01-08-2010 01:05 PM
01-11-2010 08:04 PM
if(args.nodeRef != null && args.nodeRef != "")
{
folder = search.findNode(args.nodeRef);
if(folder != null)
{
if(folder.hasPermission("_ReadPermissions"))
{
record = folder.permissions;
for(i=0; i<record.length;i++)
{
group = record[i].split(";")[1];
if (/^GROUP_(.*?)Approvers?$/i.test(group))
{
for each (approver in people.getMembers(people.getGroup(group)))
{
if(person.properties.userName == approver.properties.userName)
{
model.approver = "true";
}
}
}
}
}
}
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.