async def METHOD_NAME(
    self,
    conn: SAConnection,
    tag_id: int,
    *,
    read: bool | None = None,
    write: bool | None = None,
    delete: bool | None = None,
) -> int:
    """
    Returns 0 if tag does not match access
    Returns >0 if it does and represents the number of groups granting this access to the user
    """
    access = []
    if read is not None:
        access.append(tags_to_groups.c.read == read)
    if write is not None:
        access.append(tags_to_groups.c.write == write)
    if delete is not None:
        access.append(tags_to_groups.c.delete == delete)
    if not access:
        raise ValueError("Undefined access")
    j = self._join_user_groups_tag(
        access_condition=functools.reduce(sa.and_, access),
        tag_id=tag_id,
    )
    stmt = sa.select(sa.func.count(user_to_groups.c.uid)).select_from(j)
    # The number of occurrences of the user_id = how many groups are giving this access permission
    permissions_count: int | None = await conn.scalar(stmt)
    return permissions_count if permissions_count else 0