dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #23911
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11654: external access, added new authorities for allowing externalizing charts, maps and reporttables
------------------------------------------------------------
revno: 11654
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-08-13 13:06:13 +0200
message:
external access, added new authorities for allowing externalizing charts, maps and reporttables
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java
dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/security.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties
--
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-api/src/main/java/org/hisp/dhis/common/SharingUtils.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java 2013-08-13 08:06:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/SharingUtils.java 2013-08-13 11:06:13 +0000
@@ -105,9 +105,9 @@
addType( PatientTabularReport.class, "patientTabularReport", null, "F_PATIENT_TABULAR_REPORT_PUBLIC_ADD", null );
addType( PatientAggregateReport.class, "patientAggregateReport", null, "F_PATIENT_TABULAR_REPORT_PUBLIC_ADD", null );
- addType( org.hisp.dhis.mapping.Map.class, "map", "F_MAP_EXTERNAL_ADD", "F_MAP_PUBLIC_ADD", null );
- addType( Chart.class, "chart", "F_CHART_PUBLIC_ADD", "F_CHART_PUBLIC_ADD", null );
- addType( ReportTable.class, "reportTable", "F_REPORTTABLE_OPEN_ADD", "F_REPORTTABLE_PUBLIC_ADD", null );
+ addType( org.hisp.dhis.mapping.Map.class, "map", "F_MAP_EXTERNAL", "F_MAP_PUBLIC_ADD", null );
+ addType( Chart.class, "chart", "F_CHART_EXTERNAL", "F_CHART_PUBLIC_ADD", null );
+ addType( ReportTable.class, "reportTable", "F_REPORTTABLE_EXTERNAL", "F_REPORTTABLE_PUBLIC_ADD", null );
addType( PhoneNumberPattern.class, "phoneNumberPattern", null, null, null );
}
@@ -327,9 +327,10 @@
*/
public static <T extends IdentifiableObject> boolean canExternalize( User user, T object )
{
- return (object.getClass().isAssignableFrom( org.hisp.dhis.mapping.Map.class ) ||
- object.getClass().isAssignableFrom( ReportTable.class ) ||
- object.getClass().isAssignableFrom( Chart.class )) && sharingOverrideAuthority( user );
+ Set<String> authorities = user.getUserCredentials().getAllAuthorities();
+
+ return EXTERNAL_AUTHORITIES.get( object.getClass() ) != null &&
+ (sharingOverrideAuthority( user ) || authorities.contains( EXTERNAL_AUTHORITIES.get( object.getClass() ) ));
}
private static boolean sharingOverrideAuthority( User user )
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/security.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/security.xml 2013-08-13 07:18:45 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/security.xml 2013-08-13 11:06:13 +0000
@@ -263,6 +263,9 @@
<value>F_MAP_PUBLIC_ADD</value>
<value>F_USERGROUP_PUBLIC_ADD</value>
<value>F_REPORTTABLE_PUBLIC_ADD</value>
+ <value>F_MAP_EXTERNAL</value>
+ <value>F_CHART_EXTERNAL</value>
+ <value>F_REPORTTABLE_EXTERNAL</value>
<value>F_METADATA_EXPORT</value>
<value>F_METADATA_IMPORT</value>
</set>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties 2013-08-12 06:23:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties 2013-08-13 11:06:13 +0000
@@ -104,9 +104,11 @@
F_REPORT_PRIVATE_ADD=Add/Update Private Report
F_REPORT_DELETE=Delete Report
F_REPORTTABLE_PUBLIC_ADD=Add/Update Public Report Table
+F_REPORTTABLE_EXTERNAL=Report Table External Access
F_REPORTTABLE_DELETE=Delete Report Table
F_REPORT_VIEW=View Report
F_CHART_PUBLIC_ADD=Add/Update Public Chart
+F_CHART_EXTERNAL=Chart External Access
F_CHART_ADD=Add/Update Chart
F_CHART_DELETE=Delete Chart
F_DOCUMENT_PUBLIC_ADD=Add/Update Public Document
@@ -194,6 +196,7 @@
F_RELATIONSHIP_DELETE=Delete Relationship
F_GIS_ADMIN=Administrate GIS
F_MAP_PUBLIC_ADD=Add Public Map
+F_MAP_EXTERNAL=Map External Access
F_DATAMART_ADMIN=Administrate data mart
F_SCHEDULING_ADMIN=Scheduling Administration
F_SQLVIEW_ADD=Add/Update Sql View