Merge branch '6.0.x'
This commit is contained in:
commit
072feb2fb8
|
@ -125,8 +125,8 @@ public final class AuthorityAuthorizationManager<T> implements AuthorizationMana
|
||||||
String[] result = new String[roles.length];
|
String[] result = new String[roles.length];
|
||||||
for (int i = 0; i < roles.length; i++) {
|
for (int i = 0; i < roles.length; i++) {
|
||||||
String role = roles[i];
|
String role = roles[i];
|
||||||
Assert.isTrue(rolePrefix.isEmpty() || !role.startsWith(rolePrefix), () -> role + " should not start with " + rolePrefix + " since "
|
Assert.isTrue(rolePrefix.isEmpty() || !role.startsWith(rolePrefix), () -> role + " should not start with "
|
||||||
+ rolePrefix
|
+ rolePrefix + " since " + rolePrefix
|
||||||
+ " is automatically prepended when using hasAnyRole. Consider using hasAnyAuthority instead.");
|
+ " is automatically prepended when using hasAnyRole. Consider using hasAnyAuthority instead.");
|
||||||
result[i] = rolePrefix + role;
|
result[i] = rolePrefix + role;
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,4 +271,5 @@ public class AuthorityAuthorizationManagerTests {
|
||||||
void hasAnyRoleWhenEmptyRolePrefixThenNoException() {
|
void hasAnyRoleWhenEmptyRolePrefixThenNoException() {
|
||||||
AuthorityAuthorizationManager.hasAnyRole("", new String[] { "USER" });
|
AuthorityAuthorizationManager.hasAnyRole("", new String[] { "USER" });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue