Skip to content

Commit e1be0a0

Browse files
committed
Roles And Authority getting overridern and not available in authetication manager
Signed-off-by: Suraj Bhadrike <surajbh2233@gmail.com> Signed-off-by: surajbh <surajbh2233@gmail.com>
1 parent 226e81d commit e1be0a0

File tree

1 file changed

+1
-1
lines changed
  • core/src/main/java/org/springframework/security/core/userdetails

1 file changed

+1
-1
lines changed

core/src/main/java/org/springframework/security/core/userdetails/User.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ public UserBuilder authorities(GrantedAuthority... authorities) {
441441
*/
442442
public UserBuilder authorities(Collection<? extends GrantedAuthority> authorities) {
443443
Assert.notNull(authorities, "authorities cannot be null");
444-
this.authorities = new ArrayList<>(authorities);
444+
this.authorities.addAll(authorities);
445445
return this;
446446
}
447447

0 commit comments

Comments
 (0)