mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-31 07:27:57 +00:00
fix classification attribute access for viewers (not custom roles) (#24092)
This commit is contained in:
parent
41c8d6cc6b
commit
18c77faea5
6
docs/static/frigate-api.yaml
vendored
6
docs/static/frigate-api.yaml
vendored
@ -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:
|
||||
|
||||
@ -85,6 +85,7 @@ def require_admin_by_default():
|
||||
"/sub_labels",
|
||||
"/plus/models",
|
||||
"/recognized_license_plates",
|
||||
"/classification/attributes",
|
||||
"/timeline",
|
||||
"/timeline/hourly",
|
||||
"/recordings/storage",
|
||||
|
||||
@ -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'.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user