You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2015/06/18 11:41:00 UTC

[jira] [Updated] (OAK-2991) group.removeMember() on result of user.memberOf() does not work

     [ https://issues.apache.org/jira/browse/OAK-2991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

angela updated OAK-2991:
------------------------
    Component/s:     (was: security)
                 core

> group.removeMember() on result of user.memberOf() does not work
> ---------------------------------------------------------------
>
>                 Key: OAK-2991
>                 URL: https://issues.apache.org/jira/browse/OAK-2991
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.2.2
>            Reporter: Alexander Klimetschek
>
> When using the group from the memberOf() iterator to remove a user from that group, the change is not persisted. One has to fetch the group separately from the UserManager.
> {code}
> final Iterator<Group> groups = user.memberOf();
> while (groups.hasNext()) {
>     Group group = groups.next();
>     group.removeMember(user); // does not work
>     session.save();
>     
>     group = userManager.getGroup(group.getID());
>     group.removeMember(user); // does work
>     session.save(); 
> }
> {code}
> Note that {{removeMember()}} always returns true, indicating that the change worked. Debugging through the code, especially MembershipWriter, shows that the rep:members property is correctly updated, so probably some later modification restores the original value before the save is executed. (No JCR events are triggered for the group).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)