def METHOD_NAME(self, user=AnonymousUser()):
    """
    Return whether this album is visible for the supplied user.
    If visibility is 'p' then all users can see the album.
    If visibility is 'u' all logged in users can see the album.
    All logged in users with the permission to change albums can see the album.
    """
    return (
        self.visibility == "p"
        or self.visibility == "u"
        and user.is_authenticated
        or user.has_perm("content.change_album")
    )