AccessControl changeOwnership ignores recursive argument

Bug #425807 reported by Martin Aspeli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
New
Undecided
Unassigned

Bug Description

In AcessControl.Owned, we have:

    def changeOwnership(self, user, recursive=0):
        """Change the ownership to the given user.

        If 'recursive' is true then also take ownership of all sub-objects,
        otherwise sub-objects retain their ownership information.
        """

        new=ownerInfo(user)
        if new is None: return # Special user!
        old = self.getOwnerTuple()
        if not recursive:
            if old==new: return
            if old is UnownableOwner: return

        for child in self.objectValues():
            if recursive:
                child.changeOwnership(user, 1)
            else:
                # make ownership explicit
                child._owner=new

        if old is not UnownableOwner:
            self._owner=new

If recursive is False, this code still changes ownership of all children, even if recursive is False, which seems wrong.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.