On 20/07/2017 13:40, Colm O hEigeartaigh wrote:
Hi all,
In UserTO, we maintain a list of static group memberships via the
MembershipTO class. However, for dynamic group membership, we just maintain
a list of Strings, which correspond to the Id of the group.
So for example, if we do a GET on a given user we could see something like:
"memberships":[{"type":"Membership","rightType":"GROUP","rightKey":"06fba4e9-a013-4ffc-bba4-e9a0133ffc79","groupName":"tempgroup"
"dynGroups":["06fba4e9-a013-4ffc-bba4-e9a0133ffc79"]
One drawback to this approach is that if we want to find the names of the
groups a user is a member of, including dynamic membership, then we need to
make a separate request with a fiql search query to return the groups, and
then parse the response appropriately.
Ideally we would be able to see the group names for the dynamic case as
well when retrieving the users - this means only one call would be needed.
Would it be possible to update UserTO with a list of MembershipTOs that
correspond to the dynamic case?
Hi Colm,
it seems there are no much people around interested in dynamic
memberships :-)
Anyway, your proposed change looks fine, but I would not mix in the same
field both static and dynamic memberships; hence, I propose to:
* keep List<MembershipTO> memberships
* change List<String> dynGroups into List<MembershipTO> dynMemberships,
where each MembershipTO has naturally empty attributes lists
WDYT?
Regards.
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/