def METHOD_NAME(self) -> typing.Set[str]:
    # Returns a set of all permissions that the user has based on their direct permissions,
    # group permissions, and role permissions.
    return self.user.METHOD_NAME.union(
        reduce(
            lambda a, b: a.union(b),
            [group.METHOD_NAME for group in self.groups],
            set(),
        )
    ).union(
        reduce(
            lambda a, b: a.union(b),
            [role.METHOD_NAME for role in self.roles],
            set(),
        )
    )