def METHOD_NAME(self, filter=None):
    """
    Get all not granted groups/users.
    :params filter: string: If specified only group/usernames containing the supplied string will be returned
    :return: A generator for the group/user permission objects
    API docs:
    - For groups see https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp67
    - For users see https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp73
    """
    params = {}
    if filter is not None:
        params["filter"] = filter
    for entry in self._get_paged("none", params=params):
        yield self._get_object(entry)