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

View File

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

View File

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