[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /auth lonroles.pm

raeburn raeburn at source.lon-capa.org
Thu Dec 27 17:48:01 EST 2012


raeburn		Thu Dec 27 22:48:01 2012 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/auth	lonroles.pm 
  Log:
  - For 2.11
    - Backport 1.278.
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.269.2.4 loncom/auth/lonroles.pm:1.269.2.5
--- loncom/auth/lonroles.pm:1.269.2.4	Thu Dec 13 21:11:17 2012
+++ loncom/auth/lonroles.pm	Thu Dec 27 22:48:01 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.269.2.4 2012/12/13 21:11:17 raeburn Exp $
+# $Id: lonroles.pm,v 1.269.2.5 2012/12/27 22:48:01 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1662,6 +1662,11 @@
                 $setprivs = 1;
             }
         }
+        unless ($setprivs) {
+            if (!exists($env{'user.priv.'.$env{'form.switchrole'}.'./'})) {
+                $setprivs = 1;
+            }
+        }
         if ($setprivs) {
             if ($env{'form.switchrole'} =~ m-^(in|ta|ep|ad|st|cr)([\w/]*)\./\Q$cdom\E/\Q$cnum\E/?(\w*)$-) {
                 my $role = $1;
@@ -1689,7 +1694,11 @@
                     $spec .= '/'.$usec;
                     $area .= '/'.$usec;
                 }
-                &Apache::lonnet::standard_roleprivs(\%newrole,$role,$cdom,$spec,$cnum,$area);
+                if ($role =~ /^cr/) {
+                    &Apache::lonnet::custom_roleprivs(\%newrole,$role,$cdom,$cnum,$spec,$area);
+                } else {
+                    &Apache::lonnet::standard_roleprivs(\%newrole,$role,$cdom,$spec,$cnum,$area);
+                }
                 &Apache::lonnet::set_userprivs(\%userroles,\%newrole,\%newgroups);
                 my $adhocstart = $refresh-1;
                 $userroles{'user.role.'.$spec} = $adhocstart.'.';




More information about the LON-CAPA-cvs mailing list