Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Bug #1811 (closed)

Opened 9 years ago

Closed 9 years ago

Permissions: Moving user between groups

Reported by: jburel Owned by: jamoore
Priority: critical Cc: atarkowska
Sprint: 2010-03-19 (5)
Total Remaining Time: n.a.

Description

Scenario:

  • Create an experimenter: user1 as owner of group1
  • Create a group: group2
  • Add user1 as a member of group2 (not owner) using the method addGroups(user1, {group2}) from IAdmin.

The user1 is correctly added to group2 and is still in group1 BUT user1 is no longer an owner of group1, user1 is now a basic member.

Change History (2)

comment:1 Changed 9 years ago by jmoore

Jean-Marie, I'm having problems reproducing. Test:

    @Test
    public void testTicket1811() throws Exception {
        setup(Permissions.PRIVATE);
        assertPi(false);
        fixture.make_leader();
        assertPi(true);
        loginRoot();
        iAdmin.addGroups(fixture.user, fixture.group());
        assertPi(true);
    }

passes. The implementation looks like this:

        Experimenter foundUser = userById(user.getId(), session);
        for (ExperimenterGroup group : groups) {
            ExperimenterGroup foundGroup = groupById(group.getId(), session);
            boolean found = false;
            for (ExperimenterGroup currentGroup : foundUser
                    .linkedExperimenterGroupList()) {
                found |= HibernateUtils.idEqual(foundGroup, currentGroup);
            }
            if (!found) {
                linkGroupAndUser(foundGroup, foundUser, false); // <---- NONOWNER
                added.add(foundGroup.getName());
            }
        }

The line marked with "NONOWNER" is what creates a GroupExperimenterMap with owner == false, but that should only happen if user is not a member already. Which method are you using to create the member?

comment:2 Changed 9 years ago by jmoore

  • Resolution set to fixed
  • Sprint set to 2010-03-19 (5)
  • Status changed from new to closed

Closing. As discussed elsewhere, this was a mixup between updateSelf and updateExperimenter.

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.75803 sec.)

We're Hiring!