mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-12 21:33:30 +00:00
added createTarget method on Essence class to allow subclassing.
This commit is contained in:
parent
b5cbc977e1
commit
92dcf694b4
@ -109,7 +109,7 @@ public class LdapUserDetailsImpl implements LdapUserDetails {
|
|||||||
* Variation of essence pattern. Used to create mutable intermediate object
|
* Variation of essence pattern. Used to create mutable intermediate object
|
||||||
*/
|
*/
|
||||||
public static class Essence {
|
public static class Essence {
|
||||||
LdapUserDetailsImpl instance = new LdapUserDetailsImpl();
|
LdapUserDetailsImpl instance = createTarget();
|
||||||
List mutableAuthorities = new ArrayList();
|
List mutableAuthorities = new ArrayList();
|
||||||
|
|
||||||
public Essence() {}
|
public Essence() {}
|
||||||
@ -127,6 +127,10 @@ public class LdapUserDetailsImpl implements LdapUserDetails {
|
|||||||
setAuthorities(copyMe.getAuthorities());
|
setAuthorities(copyMe.getAuthorities());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LdapUserDetailsImpl createTarget() {
|
||||||
|
return new LdapUserDetailsImpl();
|
||||||
|
}
|
||||||
|
|
||||||
public Essence addAuthority(GrantedAuthority a) {
|
public Essence addAuthority(GrantedAuthority a) {
|
||||||
mutableAuthorities.add(a);
|
mutableAuthorities.add(a);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user