diff --git a/accounts/views.py b/accounts/views.py index c6b5f2f..d413cd4 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -3,6 +3,7 @@ from django.contrib.auth.models import User from django.contrib import auth from .forms import CreateUserForm, LoginForm from django.http import HttpResponse +from user_manager.models import UserAcl def view_create_first_user(request): @@ -13,7 +14,8 @@ def view_create_first_user(request): if form.is_valid(): username = form.cleaned_data['username'] password = form.cleaned_data['password'] - User.objects.create_superuser(username=username, password=password) + new_user = User.objects.create_superuser(username=username, password=password) + UserAcl.objects.create(user=new_user, user_level=50) return render(request, 'accounts/superuser_created.html') else: form = CreateUserForm() diff --git a/templates/user_manager/list.html b/templates/user_manager/list.html index d141e4a..68c0075 100644 --- a/templates/user_manager/list.html +++ b/templates/user_manager/list.html @@ -1,5 +1,25 @@ {% extends "base.html" %} {% block content %} -this page is just a placeholder for the moment +
Username | +User Level | ++ |
---|---|---|
{{ user_acl.user.username }} | +{{ user_acl.get_user_level_display }} | ++ + | +
Access to basic system information and logs for troubleshooting. No access to modify settings or view sensitive data such as peer keys.
+ +Full view access, including peer keys and configuration files. Cannot modify any settings or configurations.
+ +Permissions to add, edit, and remove peers and IP addresses. Does not include access to modify WireGuard instance configurations or higher-level settings.
+ +Authority to add, edit, and remove configurations of WireGuard instances.
+ +Full access across the system. Can view and modify all settings, configurations and manage users.
+ +