[LON-CAPA-cvs] cvs: loncom /auth roles.tab /lonnet/perl lonnet.pm

raeburn raeburn@source.lon-capa.org
Fri, 06 Nov 2009 01:49:11 -0000


raeburn		Fri Nov  6 01:49:11 2009 EDT

  Modified files:              
    /loncom/auth	roles.tab 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - bug 5453.
    - "bro" priv (created for Community Coordinators) now also assigned to 
       Assistant Co-Authors. 
    - &lonnet::allowed() check for "bro" access now checks user's roles for both 
      active "ca" and "aa" roles.
  
  
Index: loncom/auth/roles.tab
diff -u loncom/auth/roles.tab:1.57 loncom/auth/roles.tab:1.58
--- loncom/auth/roles.tab:1.57	Thu Oct 29 04:20:46 2009
+++ loncom/auth/roles.tab	Fri Nov  6 01:49:01 2009
@@ -26,7 +26,7 @@
 au:d are:ere:cca&IK:caa&IK
 ca:s gan:sma:bre:cre:adv:pav:pfo
 ca:d are:ere
-aa:s sma
+aa:s sma:bro
 aa:d are:ere
 dg:d bre&R
 sc:d usc
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1041 loncom/lonnet/perl/lonnet.pm:1.1042
--- loncom/lonnet/perl/lonnet.pm:1.1041	Thu Nov  5 16:04:22 2009
+++ loncom/lonnet/perl/lonnet.pm	Fri Nov  6 01:49:10 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1041 2009/11/05 16:04:22 raeburn Exp $
+# $Id: lonnet.pm,v 1.1042 2009/11/06 01:49:10 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5065,7 +5065,7 @@
                     if ($uri =~ m{^([^/]+)/?$}) {
                         my $adom = $1;
                         foreach my $key (keys(%env)) {
-                            if ($key =~ m{^user\.role\.ca/\Q$adom\E}) {
+                            if ($key =~ m{^user\.role\.(ca|aa)/\Q$adom\E}) {
                                 my ($start,$end) = split('.',$env{$key});
                                 if (($now >= $start) && (!$end || $end < $now)) {
                                     $ownaccess = 1;
@@ -5076,11 +5076,14 @@
                     } elsif ($uri =~ m{^([^/]+)/([^/]+)/?}) {
                         my $adom = $1;
                         my $aname = $2;
-                        if ($env{"user.role.ca./$adom/$aname"}) {
-                            my ($start,$end) =
-                                split('.',$env{"user.role.ca./$adom/$aname"});
-                            if (($now >= $start) && (!$end || $end < $now)) {
-                                $ownaccess = 1;
+                        foreach my $role ('ca','aa') { 
+                            if ($env{"user.role.$role./$adom/$aname"}) {
+                                my ($start,$end) =
+                                    split('.',$env{"user.role.$role./$adom/$aname"});
+                                if (($now >= $start) && (!$end || $end < $now)) {
+                                    $ownaccess = 1;
+                                    last;
+                                }
                             }
                         }
                     }