[zope2-tracker] [Bug 425807] [NEW] AccessControl changeOwnership ignores recursive argument

Martin Aspeli optilude at gmx.net
Mon Sep 7 12:39:25 EDT 2009


Public bug reported:

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.

** Affects: zope2
     Importance: Undecided
         Status: New

-- 
AccessControl changeOwnership ignores recursive argument
https://bugs.launchpad.net/bugs/425807
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.


More information about the zope2-tracker mailing list