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

raeburn lon-capa-cvs@mail.lon-capa.org
Thu, 22 Dec 2005 03:39:40 -0000


raeburn		Wed Dec 21 22:39:40 2005 EDT

  Modified files:              
    /loncom/auth	roles.tab rolesplain.tab lonroles.pm 
    /loncom/interface	lonwhatsnew.pm mydesk.tab 
  Log:
  Add whn privilege to make what's new available to cc, in, ta and custom role. Display NEW button for users with this privilege in a course.
  CeS: ----------------------------------------------------------------------
  
  
Index: loncom/auth/roles.tab
diff -u loncom/auth/roles.tab:1.46 loncom/auth/roles.tab:1.47
--- loncom/auth/roles.tab:1.46	Mon Dec 19 15:52:08 2005
+++ loncom/auth/roles.tab	Wed Dec 21 22:39:36 2005
@@ -2,17 +2,17 @@
 dc:s bre:sma:adv:mcr:srm
 dc:d cli&UIK:cau&UIK:cca&UIK:caa&UIK:cdg&UIK:mau:ccc&U:cin&UIK:cta&UIK:cep&UIK:ccr&UIK:cst&UIK:cad&UIK:csc&UIK:dro:mky:psa:usc
 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:srm:opa:mgr:mgq:rin:pch:plc:mdc:usc:vsa:vcl:mdg:vcg:pav:pfo
+cc:c cin&IK:cta&IK:cep&IK:ccr&IK:cst&IK:are:cre:ere:vgr:gan:srm:opa:mgr:mgq:rin:pch:plc:mdc:usc:vsa:vcl:mdg:vcg:pav:pfo:whn
 in:s sma:vgr:mgr:adv:vcl
-in:c vgr:mgr:mgq:gan:dcm:srm:pch&C:plc&C:dch:pac:rin:las:opa:bre:vcl:vcg:pav:pfo
+in:c vgr:mgr:mgq:gan:dcm:srm:pch&C:plc&C:dch:pac:rin:las:opa:bre:vcl:vcg:pav:pfo:whn
 ta:d sma
-ta:c bre&RL:vgr&CR:mgr&CR:srm:pch&C:plc&C:dch:pac:vcg:pfo
+ta:c bre&RL:vgr&CR:mgr&CR:srm:pch&C:plc&C:dch:pac:vcg:pfo:whn
 ep:s adv
 ep:d sma
 ep:c bre&R:mgr&R:dcm:las:pav:pfo
 cr:s adv&SR:bre&S
 cr:d sma
-cr:c bre&R:vgr&SCR:mgr&SCR:mgq&SCR:gan&SCR:dcm&SC:srm&SC:pch:plc:dch&S:pac:rin&S:las&SR:opa&SR:mdc&SR:cst&IK:pav&C:pfo&C
+cr:c bre&R:vgr&SCR:mgr&SCR:mgq&SCR:gan&SCR:dcm&SC:srm&SC:pch:plc:dch&S:pac:rin&S:las&SR:opa&SR:mdc&SR:cst&IK:pav&C:pfo&C:whn&C
 st:d sma&L
 st:c bre&RXL:pch&CL:plc&CL:pac&CL
 ad:s adv
Index: loncom/auth/rolesplain.tab
diff -u loncom/auth/rolesplain.tab:1.19 loncom/auth/rolesplain.tab:1.20
--- loncom/auth/rolesplain.tab:1.19	Mon Oct 31 16:51:42 2005
+++ loncom/auth/rolesplain.tab	Wed Dec 21 22:39:36 2005
@@ -75,3 +75,4 @@
 pfo:Print for other users and entire course
 pav:Advanced printing options (with answers, discussions, all foils, ...)
 adv:Advanced Role
+whn:Access to What's New page
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.141 loncom/auth/lonroles.pm:1.142
--- loncom/auth/lonroles.pm:1.141	Tue Dec 20 14:07:10 2005
+++ loncom/auth/lonroles.pm	Wed Dec 21 22:39:36 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.141 2005/12/20 19:07:10 albertel Exp $
+# $Id: lonroles.pm,v 1.142 2005/12/22 03:39:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -271,8 +271,9 @@
 							  '.course.helper.not.run'}) {
 				$furl = "/adm/helper/course.initialization.helper";
 				# Send the user to the course they selected
-			    } elsif ($env{'request.course.fn'}) {
-                                if ($env{'request.role.adv'}) {
+			    } elsif ($env{'request.course.id'}) {
+                                if (&Apache::lonnet::allowed('whn',
+                                                  $env{'request.course.id'})) {
                                     my $startpage = &courseloadpage($courseid);
                                     unless ($startpage eq 'firstres') {         
 				        $msg = &mt('Entering course ....');
Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.41 loncom/interface/lonwhatsnew.pm:1.42
--- loncom/interface/lonwhatsnew.pm:1.41	Wed Dec 21 21:38:44 2005
+++ loncom/interface/lonwhatsnew.pm	Wed Dec 21 22:39:39 2005
@@ -1,5 +1,5 @@
 #
-# $Id: lonwhatsnew.pm,v 1.41 2005/12/22 02:38:44 raeburn Exp $
+# $Id: lonwhatsnew.pm,v 1.42 2005/12/22 03:39:39 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -62,10 +62,11 @@
     $r->send_http_header;
     my $crsid = $env{'request.course.id'};
     $crsid =~ s/_/\//; 
-    if ((!($env{'request.course.id'})) || 
-                             ($env{'request.role'} !~ /\Q$crsid\E$/)) {
+    if ((!($env{'request.course.fn'})) || 
+                             (!(&Apache::lonnet::allowed('whn',
+                                                $env{'request.course.id'})))) {
         # Not in a course, or no role in course
-        $env{'user.error.msg'}="/adm/whatsnew::0:0:Cannot display what's new screen";
+        $env{'user.error.msg'}="/adm/whatsnew::whn:0:0:Cannot display what's new page";
         return HTTP_NOT_ACCEPTABLE;
     }
 
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.69 loncom/interface/mydesk.tab:1.70
--- loncom/interface/mydesk.tab:1.69	Tue Nov 22 15:53:09 2005
+++ loncom/interface/mydesk.tab	Wed Dec 21 22:39:39 2005
@@ -57,7 +57,7 @@
 #7:1:course:any:grps.gif:course[_12]:groups[_1]:go('/adm/coursegroups');:Enter my groups in the course
 #7:1:course_vcg:any:grps.gif:course[_12]:groups[_1]:go('/adm/coursegroups');:Enter any group in the course
 #7:1:course_mdg:any:grps.gif:course[_12]:groups[_1]:go('/adm/coursegroups');:Edit any group in the course
-7:1:pgan:$crs:new.gif:what is[_1]:new[_1]:go('/adm/whatsnew');:What's new?
+7:1:pwhn:$crs:new.gif:what is[_1]:new[_1]:go('/adm/whatsnew');:What's new?
 7:2:clear
 7:2:adv:rcm:egrd.gif:enter[_1]:grades[_2]:go('/adm/grades');:Enter grades from check-out assessment resources
 7:2:pusc:$requested_domain:sctr.gif:send[_1]:scantron[_1]:gocmd('/adm/grades','scantronupload');:Send Scantron data to a course