← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6082: Added missing authority to validation rule module

 

------------------------------------------------------------
revno: 6082
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-02-22 18:43:09 +0100
message:
  Added missing authority to validation rule module
modified:
  dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/searchResult.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-validationrule/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml	2012-02-22 17:36:22 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml	2012-02-22 17:43:09 +0000
@@ -186,6 +186,7 @@
 
     <action name="editDataValue" class="org.hisp.dhis.validationrule.action.dataanalysis.EditDataValueAction">
       <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+      <param name="requiredAuthorities">F_DATAVALUE_ADD,F_DATAVALUE_UPDATE,F_DATAVALUE_DELETE</param>
     </action>
 
     <action name="markForFollowup" class="org.hisp.dhis.validationrule.action.dataanalysis.MarkForFollowupAction">

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/searchResult.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/searchResult.vm	2012-02-22 17:36:22 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/searchResult.vm	2012-02-22 17:43:09 +0000
@@ -11,6 +11,8 @@
     var i18n_unmark_value_for_followup = '$encoder.jsEscape( $i18n.getString( "unmark_value_for_followup" ) , "'")';
 </script>
 
+#set( $hasAccess = $auth.hasAccess( "dhis-web-validationrule", "editDataValue" ) )
+
 #if ( $dataValues.size() == 0 )
 
 <span id="info">$i18n.getString( "no_values_found" )</span>
@@ -49,7 +51,7 @@
 		<td style="text-align:center">$value.min</td>
 		
 		<td style="width:100px">
-			<input id="value-${count}-val" value="$value.value" style="width: 95%; text-align: center;" tabindex="$count" type="text" onchange="editValue( $count )">			
+			<input id="value-${count}-val" value="$value.value" style="width: 95%; text-align: center;" tabindex="$count" type="text" onchange="editValue( $count )"#if( !$hasAccess ) disabled="disabled"#end>			
             <input type="hidden" id="value-${count}-de" value="$value.dataElementId">
             <input type="hidden" id="value-${count}-pe" value="$value.periodId">
             <input type="hidden" id="value-${count}-ou" value="$value.sourceId">