mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-28 18:36:23 +02:00
Use RBAC for listing thread snapshots
This commit is contained in:
parent
fb371d09f5
commit
ab3d99d9e0
2 changed files with 10 additions and 7 deletions
|
|
@ -366,11 +366,14 @@ async def list_snapshots_for_thread(
|
|||
if not thread:
|
||||
raise HTTPException(status_code=404, detail="Thread not found")
|
||||
|
||||
if thread.created_by_id != user.id:
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail="Only the creator can view snapshots",
|
||||
)
|
||||
# Check permission to view public share links
|
||||
await check_permission(
|
||||
session,
|
||||
user,
|
||||
thread.search_space_id,
|
||||
Permission.PUBLIC_SHARING_VIEW.value,
|
||||
"You don't have permission to view public share links",
|
||||
)
|
||||
|
||||
result = await session.execute(
|
||||
select(PublicChatSnapshot)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue