Closed Bug 312437 Opened 19 years ago Closed 19 years ago

Do not display the "Impersonate this user" link when the user is in the bz_sudo_protect group

Categories

(Bugzilla :: User Interface, defect)

2.21
defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 2.22

People

(Reporter: LpSolit, Assigned: karl)

Details

Attachments

(1 file, 1 obsolete file)

We actually need several steps before getting an error message telling us that
the user we try to impersonate is in the bz_sudo_protect group.
admin/users/userdata.html.tmpl, line 34 should take care of that:

        <a href="relogin.cgi?action=sudo&target_login=
        [%- otheruser.login FILTER html %]">Impersonate this user</a>

It should be displayed only when [% otheruser.groups.bz_sudo_protect %] is
false. Note that 'usevisibilitygroups' doesn't need to be checked here as only
users with editusers privs can see this link; and these users can bypass this
visibility restriction anyway.
Target Milestone: --- → Bugzilla 2.22
Summary: Do not display the "Impersonate this user" when the user is in the bz_sudo_protect group → Do not display the "Impersonate this user" link when the user is in the bz_sudo_protect group
Attached patch Patch v1 (obsolete) — Splinter Review
A relatively simple change.  Since the template gets an object corresponding to
the user who we wish to edit, it's easy enough to see if the user is in the
bz_sudo_protect group, and then only display the link if they are not.

Requesting review from jouni.
Assignee: myk → karl
Status: NEW → ASSIGNED
Attachment #199565 - Flags: review?(jouni)
Comment on attachment 199565 [details] [diff] [review]
Patch v1

>+        [% IF !otheruser.in_group("bz_sudo_protect") %]

For consistency among templates, could we use otheruser.groups.bz_sudo_protect?
.in_group() is used nowhere else in templates.
Attachment #199565 - Flags: review?(jouni)
Attached patch Patch v1.1Splinter Review
Modification of attachment 199565 [details] [diff] [review] with respect to comment 2:

> For consistency among templates, could we use
otheruser.groups.bz_sudo_protect?
> .in_group() is used nowhere else in templates.

OK.
Attachment #199565 - Attachment is obsolete: true
Attachment #199631 - Flags: review?(jouni)
Comment on attachment 199631 [details] [diff] [review]
Patch v1.1

>+          <a href="relogin.cgi?action=sudo&target_login=
>+          [%- otheruser.login FILTER html %]">Impersonate this user</a>
>+        [% END %]

r=jouni, but turn the & into an &amp; prior to checkin (yes I know you didn't
cause it).
Attachment #199631 - Flags: review?(jouni) → review+
Flags: approval?
Flags: approval? → approval+
Checking in template/en/default/admin/users/userdata.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/users/userdata.html.tmpl,v
 <--  userdata.html.tmpl
new revision: 1.3; previous revision: 1.2
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: