Skip to content

Commit

Permalink
Fix required roles to access vectorsets API
Browse files Browse the repository at this point in the history
  • Loading branch information
jotare committed Jan 29, 2025
1 parent 9eb9146 commit 58cc632
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nucliadb/src/nucliadb/writer/api/v1/vectorsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from nucliadb_models.resource import (
NucliaDBRoles,
)
from nucliadb_utils.authentication import requires
from nucliadb_utils.authentication import requires_one


@api.post(
Expand All @@ -41,7 +41,7 @@
# TODO: remove when the feature is mature
include_in_schema=False,
)
@requires(NucliaDBRoles.MANAGER)
@requires_one([NucliaDBRoles.MANAGER, NucliaDBRoles.WRITER])
@version(1)
async def add_vectorset(request: Request, kbid: str, vectorset_id: str) -> Response:
try:
Expand All @@ -63,7 +63,7 @@ async def add_vectorset(request: Request, kbid: str, vectorset_id: str) -> Respo
# TODO: remove when the feature is mature
include_in_schema=False,
)
@requires(NucliaDBRoles.MANAGER)
@requires_one([NucliaDBRoles.MANAGER, NucliaDBRoles.WRITER])
@version(1)
async def delete_vectorset(request: Request, kbid: str, vectorset_id: str) -> Response:
try:
Expand Down

0 comments on commit 58cc632

Please sign in to comment.