From 1cba7113a75eff72dcecca252715638518d672f3 Mon Sep 17 00:00:00 2001 From: Danny Glin Date: Mon, 14 Oct 2024 17:07:02 -0600 Subject: [PATCH] Change checkbox list of user roles on config page to depend on %userRoles rather than be hard-coded --- 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..2c70f183d1 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(''); }