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:
@@ -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<GrantedAuthority> AUTHORITIES = new ArrayList<GrantedAuthority>();
|
||||
|
||||
static {
|
||||
AUTHORITIES.add(new GrantedAuthorityImpl("ROLE_USER"));
|
||||
AUTHORITIES.add(new SimpleGrantedAuthority("ROLE_USER"));
|
||||
}
|
||||
|
||||
public Authentication authenticate(Authentication auth) throws AuthenticationException {
|
||||
|
||||
Reference in New Issue
Block a user