fix: access control
Some checks failed
Deploy to HuggingFace Spaces / check-secret (push) Successful in 17s
Create and publish Docker images with specific build args / build-main-image (linux/amd64) (push) Failing after 3m38s
Create and publish Docker images with specific build args / build-main-image (linux/arm64) (push) Failing after 3m38s
Create and publish Docker images with specific build args / merge-main-images (push) Has been skipped
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64) (push) Failing after 5m22s
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64) (push) Failing after 4m35s
Create and publish Docker images with specific build args / merge-cuda-images (push) Has been skipped
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64) (push) Failing after 9m3s
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64) (push) Failing after 8m16s
Create and publish Docker images with specific build args / merge-ollama-images (push) Has been skipped
Python CI / Format Backend (3.11) (push) Failing after 2m9s
Frontend Build / Format & Build Frontend (push) Failing after 1m37s
Frontend Build / Frontend Unit Tests (push) Failing after 1m35s
Integration Test / Run Cypress Integration Tests (push) Failing after 3m8s
Integration Test / Run Migration Tests (push) Failing after 2m19s
Deploy to HuggingFace Spaces / deploy (push) Has been skipped

This commit is contained in:
Timothy Jaeryang Baek 2024-11-17 14:03:51 -08:00
parent 17c9a92767
commit 6906a0bd26

View File

@ -1147,7 +1147,7 @@ async def generate_chat_completions(
# Check if user has access to the model # Check if user has access to the model
if user.role == "user": if user.role == "user":
model_info = Models.get_model_by_id(model_id) model_info = Models.get_model_by_id(model_id)
if not ( if model_info and not (
user.id == model_info.user_id user.id == model_info.user_id
or has_access( or has_access(
user.id, type="read", access_control=model_info.access_control user.id, type="read", access_control=model_info.access_control