[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm roles.tab rolesplain.tab

raeburn raeburn at source.lon-capa.org
Wed Oct 5 09:30:16 EDT 2016


raeburn		Wed Oct  5 13:30:16 2016 EDT

  Modified files:              
    /loncom/auth	roles.tab rolesplain.tab lonroles.pm 
  Log:
  - Add role for domain helpdesk staff 
  
  
Index: loncom/auth/roles.tab
diff -u loncom/auth/roles.tab:1.61 loncom/auth/roles.tab:1.62
--- loncom/auth/roles.tab:1.61	Fri Oct 21 16:03:11 2011
+++ loncom/auth/roles.tab	Wed Oct  5 13:30:16 2016
@@ -1,6 +1,6 @@
 su:s csu&U:sma:mau:cdc&U:dro:psa:adv
 dc:s bre:sma:adv:mcr:srm
-dc:d cli&UIK:cau&UIK:cca&UIK:caa&UIK:cdg&UIK:mau:ccc&U:cco&U:cin&UIK:cta&UIK:cep&UIK:ccr&UIK:cst&UIK:cad&UIK:csc&UIK:dro:mky:psa:usc:mpq:mut:eco&U
+dc:d cli&UIK:cau&UIK:cca&UIK:caa&UIK:cdg&UIK:cdh&UIK:mau:ccc&U:cco&U:cin&UIK:cta&UIK:cep&UIK:ccr&UIK:cst&UIK:cad&UIK:csc&UIK:dro:mky:psa:usc:mpq:mut:eco&U
 cc:s bre:sma:mcr:vsa:adv:vcl
 cc:c cin&IK:cta&IK:cep&IK:ccr&IK:cst&IK:are:cre:ere:vgr:gan:dcm:evb:srm:dff:opa:mgr:mqg:mgq:rin:pch:plc:mdc:usc:vsa:vcl:mdg:vcg:pav:pfo:whn:las:pac:dch
 co:s bro:sma:mcr:vsa:adv:vcl 
@@ -14,7 +14,7 @@
 ep:c bre&R:mgr&R:mqg&R:dcm:evb:las:pav:pfo
 cr:s adv&SR:bre&S:bro&S
 cr:d sma
-cr:c bre&R:vgr&SCR:mgr&SCR:mqg&SCR:mgq&SCR:gan&SCR:dcm&SC:evb&SC:srm&SC:dff&SC:pch:plc:dch&S:pac:rin&S:las&SR:opa&SR:mdc&SR:cst&IK:pav&C:pfo&C:whn&C
+cr:c bre&R:vgr&SCR:mgr&SCR:mqg&SCR:mgq&SCR:gan&SCR:dcm&SC:evb&SC:srm&SC:dff&SC:pch:plc:dch&S:pac:rin&S:las&SR:opa&SR:vpa&SR:mdc&SR:cst&IK:vcl&C:pav&C:pfo&C:whn&C
 st:d sma&L
 st:c bre&RXL:pch&CL:plc&CL:pac&CL
 ad:s adv
@@ -29,6 +29,7 @@
 aa:s sma:bro:pav
 aa:d are:ere
 dg:d bre&R
+dh:d sma:rar:dcd
 sc:d usc
 
 
Index: loncom/auth/rolesplain.tab
diff -u loncom/auth/rolesplain.tab:1.44 loncom/auth/rolesplain.tab:1.45
--- loncom/auth/rolesplain.tab:1.44	Thu Mar 24 00:07:24 2016
+++ loncom/auth/rolesplain.tab	Wed Oct  5 13:30:16 2016
@@ -25,6 +25,7 @@
 li:Librarian
 au:Author
 dg:Domain Guest
+dh:Domain Helpdesk
 ca:Co-Author
 aa:Assistant Co-Author
 sc:Bubblesheet Scanning Operator
@@ -41,6 +42,7 @@
 cli:Grant/revoke role of Librarian
 cau:Grant/revoke role of Author
 cdg:Grant/revoke role of Domain Guest
+cdh:Grant/revoke role of Domain Helpdesk
 cca:Grant/revoke role of Co-Author
 caa:Grant/revoke role of Assistant Co-Author
 csc:Grant/revoke role of Bubblesheet Scanning Operator
@@ -78,9 +80,12 @@
 vcg:View course groups
 las:Lock and unlock assessments
 opa:Set assessment parameters
+vpa:View assessment parameters
 ain:Assume a student's identity:Assume a member's identity
 psa:Post system frontpage announcements
 usc:Upload bubblesheet data
+rar:Receive ad hoc role in course or community
+dcd:Display detailed information in course catalog  
 pfo:Print for other users and entire course
 pav:Advanced printing options (with answers, discussions, all foils, ...)
 adv:Advanced Role
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.314 loncom/auth/lonroles.pm:1.315
--- loncom/auth/lonroles.pm:1.314	Wed May  4 05:14:49 2016
+++ loncom/auth/lonroles.pm	Wed Oct  5 13:30:16 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.314 2016/05/04 05:14:49 raeburn Exp $
+# $Id: lonroles.pm,v 1.315 2016/10/05 13:30:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -264,8 +264,15 @@
         my $locknum=&Apache::lonnet::get_locks();
         if ($locknum) { return 409; }
 
+        my $custom_adhoc;
         if ($env{'form.newrole'}) {
             $env{'form.'.$env{'form.newrole'}}=1;
+# Check if this is a Domain Helpdesk role trying to enter a course
+            if ($env{'form.newrole'} =~ m{^cr/($match_domain)/\1\-domainconfig/\w+\./\1/$match_courseid$}) {
+                if (&Apache::lonnet::allowed('rar',$1)) {
+                    $custom_adhoc = 1;
+                }
+            }
 	}
 	if ($env{'request.course.id'}) {
             # Check if user is CC trying to select a course role
@@ -296,8 +303,26 @@
 				 "request.role"                => 'cm',
                                  "request.role.adv"            => $env{'user.adv'},
 				 "request.role.domain"         => $env{'user.domain'}});
+# Check if Domain Helpdesk role trying to enter a course needs privs to be created
+        if ($env{'form.newrole'} =~ m{^cr/($match_domain)/\1\-domainconfig/(\w+)\./\1/($match_courseid)$}) {
+            my $cdom = $1;
+            my $rolename = $2;
+            my $cnum = $3;
+            if ($custom_adhoc) {
+                my %adhocroles = &Apache::lonnet::userenvironment($env{'user.domain'},$env{'user.name'},
+                                                                  'adhocroles.'.$cdom);
+                if (keys(%adhocroles)) {
+                    my @adhoc = split(',',$adhocroles{'adhocroles.'.$cdom});
+                    if (grep(/^\Q$rolename\E$/, at adhoc)) {
+                        if (&Apache::lonnet::check_adhoc_privs($cdom,$cnum,$update,$refresh,$now,
+                                                               "cr/$cdom/$cdom".'-domainconfig/'.$rolename)) {
+                            &Apache::lonnet::appenv({"environment.internal.$cdom.$cnum.cr/$cdom/$cdom".'-domainconfig'."$rolename.adhoc" => time});
+                        }
+                    }
+                }
+            }
+        } elsif ($numdc > 0) {
 # Check if user is a DC trying to enter a course or author space and needs privs to be created
-        if ($numdc > 0) {
             foreach my $envkey (keys(%env)) {
 # Is this an ad-hoc Coordinator role?
                 if (my ($ccrole,$domain,$coursenum) =
@@ -716,6 +741,12 @@
                                        $redirect_url);
                         return OK;
                     }
+                    if ($role eq 'dh') {
+                        my $redirect_url = '/adm/menu/';
+                        &redirect_user($r,&mt('Loading Domain Helpdesk Menu'),
+                                       $redirect_url);
+                        return OK;
+                    }
                     if ($role eq 'sc') {
                         my $redirect_url = '/adm/grades?command=scantronupload';
                         &redirect_user($r,&mt('Loading Data Upload Page'),




More information about the LON-CAPA-cvs mailing list