1
0
mirror of synced 2026-08-04 01:07:02 +00:00

SEC-1418: Deprecate GrantedAuthorityImpl in favour of final SimpleGrantedAuthority.

It should be noted that equality checks or lookups with Strings or other authority types will now fail where they would have succeeded before.
This commit is contained in:
Luke Taylor
2010-12-03 16:41:46 +00:00
parent 978b7d4707
commit 4a40d80da1
45 changed files with 380 additions and 414 deletions
@@ -246,7 +246,7 @@ if (principal instanceof UserDetails) {
look at some code as an example.
<programlisting language="java">import org.springframework.security.authentication.*;
import org.springframework.security.core.*;
import org.springframework.security.core.authority.GrantedAuthorityImpl;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
public class AuthenticationExample {
@@ -278,7 +278,7 @@ class SampleAuthenticationManager implements AuthenticationManager {
static final List&lt;GrantedAuthority> AUTHORITIES = new ArrayList&lt;GrantedAuthority>();
static {
AUTHORITIES.add(new GrantedAuthorityImpl("ROLE_USER"));
AUTHORITIES.add(new SimpleGrantedAuthority("ROLE_USER"));
}
public Authentication authenticate(Authentication auth) throws AuthenticationException {