async def METHOD_NAME(
    app: FastAPI, service: ServiceDockerData
) -> tuple[Optional[PositiveInt], list[ServiceAccessRightsAtDB]]:
    """Given a service, it returns the owner's group-id (gid) and a list of access rights following
    default access-rights policies
    - DEFAULT Access Rights policies:
        1. All services published in osparc prior 19.08.2020 will be visible to everyone (refered as 'old service').
        2. Services published after 19.08.2020 will be visible ONLY to his/her owner
        3. Front-end services are have execute-access to everyone
    """
    db_engine: AsyncEngine = app.state.engine
    groups_repo = GroupsRepository(db_engine)
    owner_gid = None
    group_ids: list[PositiveInt] = []
    if _is_frontend_service(service) or await _is_old_service(app, service):
        everyone_gid = (await groups_repo.get_everyone_group()).gid
        logger.debug("service %s:%s is old or frontend", service.key, service.version)
        # let's make that one available to everyone
        group_ids.append(everyone_gid)
    # try to find the owner
    possible_owner_email = [service.contact] + [
        author.email for author in service.authors
    ]
    for user_email in possible_owner_email:
        possible_gid = await groups_repo.get_user_gid_from_email(user_email)
        if possible_gid:
            if not owner_gid:
                owner_gid = possible_gid
    if not owner_gid:
        logger.warning("service %s:%s has no owner", service.key, service.version)
    else:
        group_ids.append(owner_gid)
    # we add the owner with full rights, unless it's everyone
    default_access_rights = [
        ServiceAccessRightsAtDB(
            key=service.key,
            version=service.version,
            gid=gid,
            execute_access=True,
            write_access=(gid == owner_gid),
            product_name=app.state.default_product_name,
        )
        for gid in set(group_ids)
    ]
    return (owner_gid, default_access_rights)