openslides_backend/permissions/permission_helper.py
def is_child_permission(child: Permission, parent: Permission) -> bool:
    """
    Iterate the permission tree (represented in the permissions object) from child to
    parent or until there are no parents anymore
    """
    queue: List[Permission] = [child]
    while queue:
        current = queue.pop()
        if current == parent:
            return True
        parents = permission_parents[current]
        queue.extend(parents)
    return False

    Iterate the permission tree (represented in the permissions object) from child to
    parent or until there are no parents anymore
    
Iterate the permission tree (represented in the permissions object) from child to
parent or until there are no parents anymore
Iterate the permission tree ( represented in the permissions object ) from child to parent or until there are no parents anymore
def is_child_permission(child: Permission, parent: Permission) -> bool:
    queue: List[Permission] = [child]
    while queue:
        current = queue.pop()
        if current == parent:
            return True
        parents = permission_parents[current]
        queue.extend(parents)
    return False
def is_child_permission ( child : Permission , parent : Permission ) -> bool : queue : List [ Permission ] = [ child ] while queue : current = queue . pop ( ) if current == parent : return True parents = permission_parents [ current ] queue . extend ( parents ) return False
Iterate the permission tree (represented in the permissions object) from child to
parent or until there are no parents anymore
Iterate the permission tree ( represented in the permissions object ) from child to parent or until there are no parents anymore
"""
    Iterate the permission tree (represented in the permissions object) from child to
    parent or until there are no parents anymore
    """
child
Permission
parent
Permission