dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #23905
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11649: minor fixes
------------------------------------------------------------
revno: 11649
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-08-13 09:28:25 +0200
message:
minor fixes
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/Access.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/vote/ExternalAccessVoter.java
--
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/Access.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/Access.java 2013-08-13 07:18:45 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/Access.java 2013-08-13 07:28:25 +0000
@@ -66,7 +66,7 @@
}
@JsonProperty
- @JacksonXmlProperty( localName = "manage", namespace = DxfNamespaces.DXF_2_0 )
+ @JacksonXmlProperty( localName = "externalize", namespace = DxfNamespaces.DXF_2_0 )
public boolean isExternalize()
{
return externalize;
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/vote/ExternalAccessVoter.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/vote/ExternalAccessVoter.java 2013-08-13 07:18:45 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/vote/ExternalAccessVoter.java 2013-08-13 07:28:25 +0000
@@ -95,21 +95,25 @@
{
String requestUrl = filterInvocation.getRequestUrl();
String[] urlSplit = requestUrl.split( "/" );
- String type = urlSplit[2];
- if ( urlSplit[1].equals( "api" ) && externalClasses.get( type ) != null )
+ if ( urlSplit.length > 3 )
{
- String uid = urlSplit[3];
+ String type = urlSplit[2];
- if ( CodeGenerator.isValidCode( uid ) )
+ if ( urlSplit[1].equals( "api" ) && externalClasses.get( type ) != null )
{
- IdentifiableObject identifiableObject = manager.get( externalClasses.get( type ), uid );
+ String uid = urlSplit[3];
- if ( identifiableObject != null && identifiableObject.getExternalAccess() )
+ if ( CodeGenerator.isValidCode( uid ) )
{
- LOG.debug( "ACCESS_GRANTED [" + filterInvocation.toString() + "]" );
-
- return ACCESS_GRANTED;
+ IdentifiableObject identifiableObject = manager.get( externalClasses.get( type ), uid );
+
+ if ( identifiableObject != null && identifiableObject.getExternalAccess() )
+ {
+ LOG.debug( "ACCESS_GRANTED [" + filterInvocation.toString() + "]" );
+
+ return ACCESS_GRANTED;
+ }
}
}
}