mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-28 18:36:23 +02:00
refactor: update permission checks in document and connector routes to use specific permission values
This commit is contained in:
parent
543b8b9376
commit
8e58094a86
2 changed files with 4 additions and 4 deletions
|
|
@ -1156,7 +1156,7 @@ async def list_document_versions(
|
|||
if not document:
|
||||
raise HTTPException(status_code=404, detail="Document not found")
|
||||
|
||||
await check_permission(session, user, document.search_space_id, Permission.READ)
|
||||
await check_permission(session, user, document.search_space_id, Permission.DOCUMENTS_READ.value)
|
||||
|
||||
versions = (
|
||||
await session.execute(
|
||||
|
|
@ -1191,7 +1191,7 @@ async def get_document_version(
|
|||
if not document:
|
||||
raise HTTPException(status_code=404, detail="Document not found")
|
||||
|
||||
await check_permission(session, user, document.search_space_id, Permission.READ)
|
||||
await check_permission(session, user, document.search_space_id, Permission.DOCUMENTS_READ.value)
|
||||
|
||||
version = (
|
||||
await session.execute(
|
||||
|
|
@ -1229,7 +1229,7 @@ async def restore_document_version(
|
|||
if not document:
|
||||
raise HTTPException(status_code=404, detail="Document not found")
|
||||
|
||||
await check_permission(session, user, document.search_space_id, Permission.WRITE)
|
||||
await check_permission(session, user, document.search_space_id, Permission.DOCUMENTS_UPDATE.value)
|
||||
|
||||
version = (
|
||||
await session.execute(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue