def get_groups(self) -> list[rbac.Group]:
        """Get the groups this user is a member of."""
        groups, paths, total = self.neighbors(
            graph="acls",
            direction="outbound",
            max_hops=1,
            target_types=["rbacgroup"],
            user=self,
        )
        all_groups = {}
        for path in paths:
            for edge in path:
                assert isinstance(edge, graph.RoleRelationship)
                group = groups[edge.target]
                group._acls[self.username] = edge
                all_groups[group.name] = group
        return list(groups.values())
Get the groups this user is a member of.
core/schemas/user.py