related #6753 allow metrics for anonymous users

Signed-off-by: Nico Ohnezat <nico@no-12.net>
This commit is contained in:
Nico Ohnezat
2022-09-06 00:02:31 +02:00
parent d73cc501d5
commit 82e8bcd2bb
3 changed files with 20 additions and 1 deletions

View File

@@ -96,6 +96,15 @@ register(
category=_('Authentication'),
category_slug='authentication',
)
register(
'ALLOW_METRICS_FOR_ANONYMOUS_USERS',
field_class=fields.BooleanField,
default=False,
label=_('Allow anonymous users to poll metrics'),
help_text=_('If false, only superusers and system auditors are allowed to poll metrics.'),
category=_('Authentication'),
category_slug='authentication',
)
def authentication_validate(serializer, attrs):