cancel
Showing results for 
Search instead for 
Did you mean: 

Rest for a user out of the group

soarez
Champ in-the-making
Champ in-the-making
I use the rest - /alfresco/service/api/groups/shortName/children to get all the users of the group "shortName" for example. And if i want the inverse? Get all the users outside this group? Is there a rest for this?
7 REPLIES 7

userteamdevelop
Champ in-the-making
Champ in-the-making
I have the same problem…………

fcorti
Elite Collaborator
Elite Collaborator
Hi,

What do you mean with "outside the group"?
If I understand correctly could be something like: the children of the parent node.
I don't think you want to know all the groups that are not contained in the queried group.

If your need is the first one, you can use the webscript that retrieve the parent of the group node and after the same webscript to retrieve the children.
The script that retrieve the parent is:
…/alfresco/service/api/groups/shortName/parents
Please, pay attention that the rest returns a list of nodes, because the Alfresco model is able to map several parent for a node (a subgroup could be contained in more than one group).

Hope this help.

soarez
Champ in-the-making
Champ in-the-making
Hi, thanks for helping;

There's the problem. I have 100 users in my system and 1 group called "TEST", that contains 3 users.

I looking for a scritp/rest that returns all the 97 users out of the "TEST" group. Or any way to do it using alfresco ?

fcorti
Elite Collaborator
Elite Collaborator
Hi,

So the repository should something like this:
/ (root)
- TEST (with 3 users)
- 97 users

Isn't it?

If yes, you can get all the children of the root.
Please, remember that the list of results contains both people and subgroups.

Hope this help you.

soarez
Champ in-the-making
Champ in-the-making
Actually no .

I have 100 users in the repository and 3 of then are in the group "Test"
-Repository - 100 Users

-Group TEST - 3 Users

-**Users out of TEST Group - 97**

-TOTAL - 100 users

I'm trying to retrieve all those users out of the TEST Group. If I understand your solution, this will return the 100 users.

Basically I need a Rest/Script/Query that returns users that are not part of one specific group.

fcorti
Elite Collaborator
Elite Collaborator
If you confirm that the 97 users are in the repository root (and not in subgroups) the solution I suggest retrieves 98 items: 97 users plus 1 group.

I hope this help.

userteamdevelop
Champ in-the-making
Champ in-the-making
How can I get all users, exception user´s a group for exemple: to get all users I need to use PEOPLE API, to call GROUP, I use GROUP, but how can I get all users, exception Tests´s users for exemple ? Cause I gonna use two api´s in the same url ?

thanks for helping.