add config for admins

This commit is contained in:
tuxcoder 2023-12-24 11:09:41 +01:00
parent 04846aac0e
commit ddbba31fe6
4 changed files with 16 additions and 4 deletions

View file

@ -25,6 +25,9 @@ SUBJECT_PREFIX = 'something random'
OAUTH_ID = 'identiy_provider'
OAUTH_SECRET = 'thisIsNotSecure'
ADMINS = [
'tuxcoder'
]
[LENTICULAR_CLOUD_SERVICES.jabber]
app_token = true

View file

@ -185,7 +185,8 @@ class User(BaseModel, ModelUpdatedMixin):
@property
def groups(self) -> list['Group']:
if self.username == 'tuxcoder':
admins = current_app.config['ADMINS']
if self.username in admins:
return [Group(name='admin')]
else:
return []