From addfaec137b6cdcc3def916cda12a6cdfdae2f44 Mon Sep 17 00:00:00 2001 From: Danny Glin Date: Tue, 15 Oct 2024 14:17:20 -0600 Subject: [PATCH] Make permission level checkbox list match %userRoles --- lib/WeBWorK/ConfigObject/permission_checkboxlist.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/WeBWorK/ConfigObject/permission_checkboxlist.pm b/lib/WeBWorK/ConfigObject/permission_checkboxlist.pm index 790ff3e681..4b51cd360a 100644 --- a/lib/WeBWorK/ConfigObject/permission_checkboxlist.pm +++ b/lib/WeBWorK/ConfigObject/permission_checkboxlist.pm @@ -52,8 +52,9 @@ sub comparison_value ($self, $val) { } sub entry_widget ($self, $default, $is_secret = 0) { - my $c = $self->{c}; - $default = role_and_above($self->{c}->ce->{userRoles}, $default) unless ref($default) eq 'ARRAY'; + my $c = $self->{c}; + my $userRoles = $self->{c}->ce->{userRoles}; + $default = role_and_above($userRoles, $default) unless ref($default) eq 'ARRAY'; return $c->c( map { $c->tag( @@ -72,7 +73,7 @@ sub entry_widget ($self, $default, $is_secret = 0) { )->join('') ) ) - } ('guest', 'student', 'login_proctor', 'grade_proctor', 'ta', 'professor', 'admin') + } grep { $_ ne 'nobody' } sort { $userRoles->{$a} <=> $userRoles->{$b} } keys(%$userRoles) )->join(''); }