def querySubDomain(cls,parent=None,TopLevelOnly=False): if TopLevelOnly==True: if Context.CurrentSession.allow("system"): return DomainCollection(UserHandler.find_domain(parent="")) else: return DomainCollection(UserHandler.find_domain(parent=Context.CurrentSession.domain)) if parent!=None: return DomainCollection(UserHandler.find_domain(parent=parent))
def saveDomain(cls,id,domain,parent): objid=UserHandler.update_domain(id=id,name=domain, parent=parent) return objid
def addDomain(cls,domain,parent): objid=UserHandler.update_domain(name=domain, parent=parent) return objid
def getDomain(cls,id): if not utility.is_validId(id): return None for i in DomainCollection(UserHandler.find_domain(id=id)): return i
def parent(self): for p in self.__parents__: if p!="" and p!=None: for i in DomainCollection(UserHandler.find_domain(id=p)): return i
def createDomain(cls,domain,parentDomain): UserHandler.update_domain(domain, parentDomain)