Hi,
I'm storing tuples of strings in the database (accessing via ActiveObjects).
One of the strings is the username of a bamboo user. When getting the membership of this user I usually call:
com.atlassian.user.User user = getBambooUserManager().getUser(userName);
Pager<Group> groups = getBambooUserManager().getGroups(user);
But sometimes it happens that this call will return an empty list.
When I then check using all known groups:
for(Group g : groups){
System.out.println(g.getName());
Pager<String> members = getBambooUserManager().getMemberNames(g);
for(String m : members){
User user = getBambooUserManager().getUser(m);
System.out.println(user);
}
}and iterating and checking the names of the member the affected user will be in that list of a certain group. But still calling
getBambooUserManager().getGroups(com.atlassian.user.User user)
will return an empty list.
The instance of BambooUserManager is always the same (a static reference in a class).
When I assign groups to the affected user and will double check this at /admin/user/viewUsers.action
everythings looks fine and need and the method getGroups(com.atlassian.user.User user) will return a list (or a pager) whith all assigned usergroups. When I then restart the bamboo server, the problem again occurs that the call of getGroups(User user) will return an empty list.
Best regards
Titus