What groups is a user part of
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2007 02:07 PM
Does anyone know an easy/quick method to tell which groups a user is part of?
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2007 09:09 PM
I don't know of one in the UI.
I definitely like a way to manage groups a user is a member of rather than having to go to each group one at a time and add the user.
There is this
http://wiki.alfresco.com/wiki/JavaScript_API#People_API
Array getContainerGroups(ScriptNode person)
Gets the groups that contain the specified authority.
which could be used in a template to create a custom view or something.
I definitely like a way to manage groups a user is a member of rather than having to go to each group one at a time and add the user.
There is this
http://wiki.alfresco.com/wiki/JavaScript_API#People_API
Array getContainerGroups(ScriptNode person)
Gets the groups that contain the specified authority.
which could be used in a template to create a custom view or something.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2007 06:32 PM
This is kind of dumb, I'm sure I'm just not looking in the right places, but once I do a call to getContainerGroups(…) I get a list of objects of type authorityContainer ({http://www.alfresco.org/model/user/1.0}authorityContainer). I've been looking for some documentation for this type, namely, its properties so that I can get a human-readable group name out of it.
Thanks in advance!
~Rosemary
Thanks in advance!
~Rosemary

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2007 10:21 AM
Hi
This is in userModel.xml
Andy
This is in userModel.xml
<model name="usr:usermodel" xmlns="http://www.alfresco.org/model/dictionary/1.0"> <description>Alfresco User Model</description> <author>Alfresco</author> <published>2005-08-16</published> <version>0.1</version> <imports> <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/> <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/> </imports> <namespaces> <namespace uri="http://www.alfresco.org/model/user/1.0" prefix="usr"/> </namespaces> <constraints> <constraint name="usr:userNameConstraint" type="org.alfresco.repo.dictionary.constraint.UserNameConstraint" /> <constraint name="usr:authorityNameConstraint" type="org.alfresco.repo.dictionary.constraint.AuthorityNameConstraint" /> </constraints> <types> <type name="usr:authority"> <title>Alfresco Authority Abstract Type</title> <parent>sys:base</parent> </type> <type name="usr:user"> <title>Alfresco User Type</title> <parent>usr:authority</parent> <properties> <!– The tokenisation set here is ignored - it is fixed for this type –> <!– This is so you can not break person lookup –> <property name="usr:username"> <type>d:text</type> <constraints> <constraint ref="usr:userNameConstraint" /> </constraints> </property> <property name="usr:password"> <type>d:text</type> </property> <property name="usr:enabled"> <type>d:boolean</type> </property> <property name="usr:accountExpires"> <type>d:boolean</type> </property> <property name="usr:accountExpiryDate"> <type>d:datetime</type> </property> <property name="usr:credentialsExpire"> <type>d:boolean</type> </property> <property name="usr:credentialsExpiryDate"> <type>d:datetime</type> </property> <property name="usr:accountLocked"> <type>d:boolean</type> </property> <property name="usr:salt"> <type>d:text</type> </property> </properties> </type> <type name="usr:authorityContainer"> <title>Alfresco Authority Type</title> <parent>usr:authority</parent> <properties> <!– The tokenisation set here is ignored - it is fixed for this type –> <!– This is so you can not break group lookup –> <property name="usr:authorityName"> <type>d:text</type> <constraints> <constraint ref="usr:authorityNameConstraint" /> </constraints> </property> <property name="usr:members"> <type>d:text</type> <multiple>true</multiple> </property> </properties> <associations> <child-association name="usr:member"> <source> <mandatory>false</mandatory> <many>true</many> </source> <target> <class>usr:authority</class> <mandatory>false</mandatory> <many>true</many> </target> <duplicate>false</duplicate> </child-association> </associations> </type> </types> </model>
Andy

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2007 10:41 AM
Thanks Andy.
Using the method of trial-and-error, I managed to get the information I wanted using a webscript.
Here are the guts of it, if anyone wants it (of course there's an xml file to go with this, but it's pretty standard, takes the username as a parameter):
usergroups.get.js
usergroups.get.html.ftl
Using the method of trial-and-error, I managed to get the information I wanted using a webscript.
Here are the guts of it, if anyone wants it (of course there's an xml file to go with this, but it's pretty standard, takes the username as a parameter):
usergroups.get.js
/*Get User Groups Webscript Javascript file*/var person = people.getPerson(args["name"]);model.groups = people.getContainerGroups(person);model.test = new Array();var containerGroups = people.getContainerGroups(person);for(var i=0;i<containerGroups.length;i++){ model.test = containerGroups[i].getQnamePath();}model.personName = person;
usergroups.get.html.ftl
<img src="/alfresco/images/logo/AlfrescoLogo32.png" alt="Alfresco" style="padding-right: 10px;"/><span class="mainTitle">User Groups</span><div style="margin-top: 10px;"> User ${personName.properties.userName} (${personName.properties.firstName} ${personName.properties.lastName}) is part of the groups: <ul> <#list groups as group> <li> ${group.qnamePath} </#list> </ul></div>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2008 09:01 AM
I don't know of one in the UI.
I definitely like a way to manage groups a user is a member of rather than having to go to each group one at a time and add the user.
There is this
http://wiki.alfresco.com/wiki/JavaScript_API#People_API
Array getContainerGroups(ScriptNode person)
Gets the groups that contain the specified authority.
which could be used in a template to create a custom view or something.
Is this possible using WebServices?
