← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12905: Light, improved menu and display of links according to authorities

 

------------------------------------------------------------
revno: 12905
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-11-08 12:59:56 +0100
message:
  Light, improved menu and display of links according to authorities
modified:
  dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml	2013-10-01 08:28:26 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml	2013-11-08 11:59:56 +0000
@@ -13,19 +13,15 @@
       <param name="page">/dhis-web-light/menu.vm</param>
     </action>
 
-	<!-- chart 
-	
+	<!--	
 	<action name="viewChart" class="org.hisp.dhis.light.chart.action.GetDataSetInfoForChartAction">
       <result name="success" type="velocity">/dhis-web-light/main.vm</result>
       <param name="page">/dhis-web-light/chart/viewChartInfo.vm</param>
-    </action>
-	
+    </action>	
 	-->
 	
     <!-- data entry -->
 
-    <action name="hello" class="morten.HelloAction" />
-
     <action name="selectOrganisationUnit"
         class="org.hisp.dhis.light.dataentry.action.GetOrganisationUnitsAction">
       <result name="success" type="velocity">/dhis-web-light/main.vm</result>
@@ -36,7 +32,7 @@
       <result name="selectPeriod" type="redirect">
         /light/selectPeriod.action?organisationUnitId=${organisationUnitId}&amp;dataSetId=${dataSetId}
       </result>
-      <param name="requiredAuthorities">M_dhis-web-dataentry</param>
+      <param name="requiredAuthorities">F_DATAVALUE_ADD</param>
     </action>
 
     <action name="selectDataSet"
@@ -58,6 +54,7 @@
         class="org.hisp.dhis.light.dataentry.action.GetDataSetOverviewAction">
       <result name="success" type="velocity">/dhis-web-light/main.vm</result>
       <param name="page">/dhis-web-light/dataEntryOverview.vm</param>
+      <param name="requiredAuthorities">F_DATAVALUE_ADD</param>
     </action>
 
     <action name="dataEntrySection"
@@ -531,7 +528,5 @@
 	  <param name="requiredAuthorities">F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_DELETE</param>
     </action>
     
-    
-    
   </package>
 </struts>

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm	2013-02-03 10:13:17 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm	2013-11-08 11:59:56 +0000
@@ -19,30 +19,12 @@
 <h2>$i18n.getString( "menu" )</h2>
 
 <p>
-<ul>
-	#set ( $trackingAuthority = false)
-	#set ( $aggregateAuthority = false)
-	
-	#foreach( $each in $user.getUserCredentials().getAllAuthorities() )
-		#if ( $each == 'ALL' )
-			#set ($trackingAuthority = true)
-			#set ($aggregateAuthority = true)
-        #else
-            #if ( $each == 'M_dhis-web-maintenance-patient' )                       
-				#set ($trackingAuthority = true)
-			#end
-				
-			#if ( $each == 'M_dhis-web-dataentry' )              
-				#set ($aggregateAuthority = true)
-			#end
-		#end
-	#end
-	
-	#if ( $aggregateAuthority == true)
+<ul>	
+	#if( $auth.hasAccess( "dhis-web-light", "dataEntry" ) )
 		<li><a href="selectOrganisationUnit.action">$i18n.getString( "agregate_reporting" )</a></li>
 	#end
 	
-	#if ( $trackingAuthority == true )
+    #if( $auth.hasAccess( "dhis-web-light", "registerPatientLocation" ) )
 		<li><a href="trackingMenu.action">$i18n.getString( "tracking" )</a></li>
 	#end