Require document privilege for PDF imports
This commit is contained in:
parent
2f87dbcfbc
commit
df7d32c70c
1 changed files with 2 additions and 1 deletions
|
|
@ -146,7 +146,8 @@ def setup_document_routes(session_manager, upload_handler=None) -> APIRouter:
|
||||||
from src.document_processor import _process_pdf
|
from src.document_processor import _process_pdf
|
||||||
import os
|
import os
|
||||||
|
|
||||||
user = get_current_user(request)
|
from src.auth_helpers import require_privilege
|
||||||
|
user = require_privilege(request, "can_use_documents")
|
||||||
|
|
||||||
# session_id is optional — a library import isn't tied to a chat. When
|
# session_id is optional — a library import isn't tied to a chat. When
|
||||||
# given, validate it; otherwise the PDF becomes a session-less library
|
# given, validate it; otherwise the PDF becomes a session-less library
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue