def __init__(self, context): parent = context while IInheritOwnership.providedBy(parent): parent = getattr(parent, '__parent__', None) if parent is None: raise ComponentLookupError() self._owner = IOwnership(parent)
def isAvailable(self): if checkPermission('zojax.changeOwnership', self.context): return not (IInheritOwnership.providedBy(self.context) or IUnchangeableOwnership.providedBy(self.context)) return False