06-18-2008 12:26 PM
06-18-2008 06:04 PM
function getUserGroup(person) {
// person is a Person Node
var containerGroups = people.getContainerGroups(person);
var group = containerGroups[0].getQnamePath()
var p = group.split(":");
return p[p.length-1];
}
That will give you the short name (i.e., "GROUP_Corporate") of the user's first group. Assumes they're part of a group, that you only care about the first group, etc.
11-05-2008 11:47 AM
var userName = "admin";
var user = people.getPerson(userName);
var model.groups = people.getContainerGroups(user);
<#list groups as group>
{
"id": "${group.name?js_string}",
"nodeRef": "${group.nodeRef?js_string}",
"qnamePath": "${group.qnamePath?js_string}",
"displayPath": "${group.displayPath?js_string}",
"url": "${group.url?js_string}",
"parentNodeRef": "${group.parent.nodeRef?js_string}"
}<#if group_has_next>,</#if>
</#list>
…
{
"id": "2c11331f-2897-4fbb-9114-4424dffe5002",
"nodeRef": "user://alfrescoUserStore/2c11331f-2897-4fbb-9114-4424dffe5002",
"qnamePath": "/sys:system/sys:authorities/usr:GROUP_group1/usr:GROUP_group1.1",
"displayPath": "/94cace60-351a-4e14-87a4-73321b9c9c9d/9bdfa029-0973-48e5-88fb-3aa0ab21e94c/5b44c49b-d9ce-4142-97bf-16c2090bcdac",
"url": "/n/browse/user/alfrescoUserStore/2c11331f-2897-4fbb-9114-4424dffe5002",
"parentNodeRef": "user://alfrescoUserStore/5b44c49b-d9ce-4142-97bf-16c2090bcdac"
}
…
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.