[LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm lonuserutils.pm
raeburn
raeburn at source.lon-capa.org
Thu Nov 17 14:07:21 EST 2022
raeburn Thu Nov 17 19:07:21 2022 EDT
Modified files:
/loncom/interface loncreateuser.pm lonuserutils.pm
Log:
- Don't display "Manage Users" menu with "Helpdesk Access" link to course
owner or co-owner for requests for /adm/createuser when course is being
viewed as a student.
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.463 loncom/interface/loncreateuser.pm:1.464
--- loncom/interface/loncreateuser.pm:1.463 Wed Nov 16 14:24:35 2022
+++ loncom/interface/loncreateuser.pm Thu Nov 17 19:07:21 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.463 2022/11/16 14:24:35 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.464 2022/11/17 19:07:21 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -5366,7 +5366,8 @@
'<span class="LC_error">'.&mt('You do not have permission to view change logs').'</span>');
}
} elsif ($env{'form.action'} eq 'helpdesk') {
- if (($permission->{'owner'}) || ($permission->{'co-owner'})) {
+ if (($permission->{'owner'} || $permission->{'co-owner'}) &&
+ ($permission->{'cusr'} || $permission->{'view'})) {
if ($env{'form.state'} eq 'process') {
if ($permission->{'owner'}) {
&update_helpdeskaccess($r,$permission,$brcrum);
@@ -5796,7 +5797,8 @@
icon => 'helpdesk-access.png',
#help => 'Course_Helpdesk_Access',
url => '/adm/createuser?action=helpdesk',
- permission => ($permission->{'owner'} || $permission->{'co-owner'}),
+ permission => (($permission->{'owner'} || $permission->{'co-owner'}) &&
+ ($permission->{'view'} || $permission->{'cusr'})),
linktitle => 'Helpdesk access options',
},
{
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.210 loncom/interface/lonuserutils.pm:1.211
--- loncom/interface/lonuserutils.pm:1.210 Mon Feb 14 01:15:24 2022
+++ loncom/interface/lonuserutils.pm Thu Nov 17 19:07:21 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA user accounts
#
-# $Id: lonuserutils.pm,v 1.210 2022/02/14 01:15:24 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.211 2022/11/17 19:07:21 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -6194,8 +6194,9 @@
}
}
my $allowed = 0;
- foreach my $perm (values(%permission)) {
- if ($perm) { $allowed=1; last; }
+ foreach my $key (keys(%permission)) {
+ next if (($key eq 'owner') || ($key eq 'co-owner'));
+ if ($permission{$key}) { $allowed=1; last; }
}
return (\%permission,$allowed);
}
More information about the LON-CAPA-cvs
mailing list