diff --git a/core/src/main/java/org/acegisecurity/userdetails/memory/UserAttribute.java b/core/src/main/java/org/acegisecurity/userdetails/memory/UserAttribute.java index a6e4fbcbd5..55c3465915 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/memory/UserAttribute.java +++ b/core/src/main/java/org/acegisecurity/userdetails/memory/UserAttribute.java @@ -53,6 +53,16 @@ public class UserAttribute { return (GrantedAuthority[]) this.authorities.toArray(toReturn); } + /** + * Set all authorities for this user. + * + * @param authorities {@link List} <{@link GrantedAuthority}> + * @since 1.1 + */ + public void setAuthorities(List authorities) { + this.authorities = authorities; + } + public String getPassword() { return password; } diff --git a/core/src/main/java/org/acegisecurity/userdetails/memory/UserMap.java b/core/src/main/java/org/acegisecurity/userdetails/memory/UserMap.java index 1444c15683..6882b40653 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/memory/UserMap.java +++ b/core/src/main/java/org/acegisecurity/userdetails/memory/UserMap.java @@ -86,4 +86,14 @@ public class UserMap { public int getUserCount() { return this.userMap.size(); } + + /** + * Set the users in this {@link UserMap}. Overrides previously added users. + * + * @param users {@link Map} <{@link String}, {@link UserDetails}> with pairs (username, userdetails) + * @since 1.1 + */ + public void setUsers(Map users) { + this.userMap = users; + } }