mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-28 21:49:40 +02:00
feat: fixed bugs
This commit is contained in:
parent
11b9ebd9cd
commit
b9159a8329
6 changed files with 81 additions and 17 deletions
|
|
@ -635,8 +635,16 @@ async def delete_thread(
|
|||
|
||||
# For PRIVATE threads, only the creator can delete
|
||||
# For SEARCH_SPACE threads, any member with permission can delete
|
||||
# Legacy threads (created_by_id is NULL) have no recorded creator,
|
||||
# so we skip strict ownership and fall through to legacy handling
|
||||
# which allows the search space owner to delete them
|
||||
if db_thread.visibility == ChatVisibility.PRIVATE:
|
||||
await check_thread_access(session, db_thread, user, require_ownership=True)
|
||||
await check_thread_access(
|
||||
session,
|
||||
db_thread,
|
||||
user,
|
||||
require_ownership=(db_thread.created_by_id is not None),
|
||||
)
|
||||
|
||||
await session.delete(db_thread)
|
||||
await session.commit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue