← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6204: updated security code to not use deprecated GrantedAuthorityImpl anymore, now uses SimpleGrantedA...

 

------------------------------------------------------------
revno: 6204
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-03-07 15:37:56 +0100
message:
  updated security code to not use deprecated GrantedAuthorityImpl anymore, now uses SimpleGrantedAuthority
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultUserDetailsService.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/AbstractAutomaticAccessProvider.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-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultUserDetailsService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultUserDetailsService.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultUserDetailsService.java	2012-03-07 14:37:56 +0000
@@ -37,6 +37,7 @@
 import org.springframework.dao.DataAccessException;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.authority.GrantedAuthorityImpl;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
 import org.springframework.security.core.userdetails.User;
 import org.springframework.security.core.userdetails.UserDetails;
 import org.springframework.security.core.userdetails.UserDetailsService;
@@ -93,7 +94,7 @@
         {
             for ( String authority : group.getAuthorities() )
             {
-                authorities.add( new GrantedAuthorityImpl( authority ) );
+                authorities.add( new SimpleGrantedAuthority( authority ) );
             }
         }
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/AbstractAutomaticAccessProvider.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/AbstractAutomaticAccessProvider.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/AbstractAutomaticAccessProvider.java	2012-03-07 14:37:56 +0000
@@ -35,6 +35,7 @@
 import org.hisp.dhis.user.UserService;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.authority.GrantedAuthorityImpl;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
 
 /**
  * Abstract automatic access provider class. Delegates methods initialise() and 
@@ -100,7 +101,7 @@
 
         for ( String authority : systemAuthorities )
         {
-            grantedAuthorities.add( new GrantedAuthorityImpl( authority ) );
+            grantedAuthorities.add( new SimpleGrantedAuthority( authority ) );
         }
 
         return grantedAuthorities;