Add ability to change user's permissions from admin panel user list

This commit is contained in:
jvyden 2022-06-10 17:02:02 -04:00
parent ff12f5f7d5
commit 1037a6eddb
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
6 changed files with 44 additions and 3 deletions

View file

@ -21,7 +21,11 @@ public class AdminPanelUsersPage : BaseLayout
if (user == null) return this.Redirect("~/login");
if (!user.IsAdmin) return this.NotFound();
this.Users = await this.Database.Users.OrderByDescending(u => u.UserId).ToListAsync();
this.Users = await this.Database.Users
.OrderByDescending(u => u.PermissionLevel)
.ThenByDescending(u => u.UserId)
.ToListAsync();
this.UserCount = this.Users.Count;
return this.Page();