mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-08-16 18:00:23 +03:00
fix(RBAC): skip validation for unplug
This commit is contained in:
parent
479f6af8ec
commit
a89a9c0f6b
@ -195,6 +195,13 @@ async def create_question_handler(
|
||||
)
|
||||
|
||||
# Retrieve user's OpenAI API key
|
||||
if brain_id:
|
||||
validate_brain_authorization(
|
||||
brain_id=brain_id,
|
||||
user_id=current_user.id,
|
||||
required_roles=[RoleEnum.Viewer, RoleEnum.Editor, RoleEnum.Owner],
|
||||
)
|
||||
|
||||
current_user.openai_api_key = request.headers.get("Openai-Api-Key")
|
||||
brain = Brain(id=brain_id)
|
||||
brain_details: BrainEntity | None = None
|
||||
|
Loading…
Reference in New Issue
Block a user