From e674fb613950c3fdd97fcb28364907f7a9d47ab6 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Thu, 1 Apr 2021 03:12:47 +0000 Subject: [PATCH] edit user: make the role changer checkboxes Also, it makes the role changer a bit of a dangerzone visually for admins. --- src/root/user.tt | 51 +++++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/src/root/user.tt b/src/root/user.tt index 3535bf265..76f858504 100644 --- a/src/root/user.tt +++ b/src/root/user.tt @@ -2,17 +2,23 @@ [% PROCESS common.tt %] [% BLOCK roleoption %] - -[% END %] + [% IF !mutable %] + disabled="disabled" + [% END %] + [% HTML.attributes(id => "role-${role}", value => role) %] /> +
+ [% END %]
@@ -70,16 +76,22 @@ [% IF !create || c.check_user_roles('admin') %] -
- -
- + [% mutable = c.check_user_roles('admin') %] +
+
User Roles
+
+ [% IF mutable %] +
Take care, you're allowed to change [% HTML.escape(user.fullname || user.emailaddress || "this user") %]'s roles.
+ [% ELSE %] +
[% HTML.escape(user.fullname || user.emailaddress || "this user") %]'s roles.
+ [% END %] +

+ [% INCLUDE roleoption mutable=mutable role="admin" %] + [% INCLUDE roleoption mutable=mutable role="create-projects" %] + [% INCLUDE roleoption mutable=mutable role="restart-jobs" %] + [% INCLUDE roleoption mutable=mutable role="bump-to-front" %] + [% INCLUDE roleoption mutable=mutable role="cancel-build" %] +

[% END %] @@ -115,7 +127,6 @@ Delete this user [% END %] -