fix classification attribute access for viewers (not custom roles) (#24092)

This commit is contained in:
Josh Hawkins 2026-08-25 14:40:26 -05:00 committed by GitHub
parent 41c8d6cc6b
commit 18c77faea5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 4 deletions

View File

@ -1476,7 +1476,7 @@ paths:
- Classification
summary: Get custom classification attributes
description: |-
**Access:** Admin role required.
**Access:** Authenticated user with access to all cameras.
Returns custom classification attributes for a given object type.
Only includes models with classification_type set to 'attribute'.
@ -1510,8 +1510,8 @@ paths:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- frigateAdminAuth: []
x-required-role: admin
- frigateUserAuth: []
x-required-role: all_cameras
/classification/{name}/train:
get:
tags:

View File

@ -85,6 +85,7 @@ def require_admin_by_default():
"/sub_labels",
"/plus/models",
"/recognized_license_plates",
"/classification/attributes",
"/timeline",
"/timeline/hourly",
"/recordings/storage",

View File

@ -14,7 +14,7 @@ from fastapi.responses import JSONResponse
from peewee import DoesNotExist
from playhouse.shortcuts import model_to_dict
from frigate.api.auth import require_role
from frigate.api.auth import require_full_camera_access, require_role
from frigate.api.defs.request.classification_body import (
AudioTranscriptionBody,
DeleteFaceImagesBody,
@ -741,6 +741,7 @@ def get_classification_dataset(name: str):
@router.get(
"/classification/attributes",
dependencies=[Depends(require_full_camera_access)],
summary="Get custom classification attributes",
description="""Returns custom classification attributes for a given object type.
Only includes models with classification_type set to 'attribute'.