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

angela resolved OAK-2991.
-------------------------
    Resolution: Cannot Reproduce

i will add the test-case(s) for the sake of extending our test-coverage but 
otherwise i will resolve the issue. we can still reopen it if we find it was 
really an oak issue... not sure about that.

> 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
>            Assignee: angela
>            Priority: Minor
>         Attachments: OAK-2991-testcase2.patch, OAK-2991_testcase.patch
>
>
> 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)

Reply via email to