From 0edb75d4aac76359dbf0b329a9f39e65a38eced7 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Wed, 5 Jul 2006 16:16:13 +0000 Subject: [PATCH] Added setUsers and setAuthorities for easier configuration --- .../userdetails/memory/UserAttribute.java | 10 ++++++++++ .../org/acegisecurity/userdetails/memory/UserMap.java | 10 ++++++++++ 2 files changed, 20 insertions(+) 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; + } }