Hi Louis-Marie,
I would rather go for 1) as I believe this is what these methods should
really do, and I don't see any real use case where I would want to have the
former behavior.
Cheers,
Thomas
On Thu, Jun 27, 2013 at 10:23 AM, Guillaume "Louis-Marie" Delhumeau <
gdelhumeau(a)xwiki.com> wrote:
Hi devs !
In order to fix
http://jira.xwiki.org/browse/XWIKI-2900, I have some
proposals to you.
The problem is : the Inclusion of groups in groups aren't taken into
account when querying user memberships.
Let suppose we have the following use case:
User 1 inside the Goup A
Group A inside the Group B
The actual behaviour of XwikiGroupService#
getAllGroupsNamesForMember() when calling it with "User 1" as input, is to
return "Group A" only. Because, only "Group A" has actually a member
called
"User 1".
We might want to keep this behaviour, because we may need to have only the
declared members of that group.
But we can modify this method to also returns the members of the subgroups,
by changing XwikiGroupService#getAllGroupsNamesForMember(), which returns
the groups of a member.
Other solution, adding a new method:
boolean isMemberInGroup(DocumentReference memberReference,
DocumentReference groupReference)
which only check if the user (or the group) given on the input is a member
of the group or not.
But it's an API breakage.
So my proposal is:
1/ Changing the behaviour of
XWikiGroupService#getAllGroupsNamesForMember(),
XWikiGroupService#getAllGroupsReferencesForMember(),
XWikiGroupService#getAllMembersNamesForGroup(),
XWikiGroupService#getAllMatchedMembersNamesForGroup(),
XWikiGroupService#countAllGroupsNamesForMember() and
XWikiGroupService#countAllMembersNamesForGroup()
or
2/ Adding isMemberInGroup(DocumentReference memberReference,
DocumentReference groupReference, XWikiContext context) in
XWikiGroupService, which is an API breakage, and my Pull Request :
https://github.com/xwiki/xwiki-platform/pull/117/
or
3/ Only change XWikiUser#isUserInGroup() and do the recursive stuff there.
Thanks for your help!
Louis-Marie
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs