Skip to content

Commit 80d7da1

Browse files
Update javadoc
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
1 parent 1a8494a commit 80d7da1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/src/main/java/org/springframework/security/access/expression/SecurityExpressionRoot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private boolean isGranted(AuthorizationManager<T> authorizationManager) {
229229
/**
230230
* Convenience method to access {@link Authentication#getPrincipal()} from
231231
* {@link #getAuthentication()}
232-
* @return
232+
* @return the {@code Principal} being authenticated or the authenticated principal after authentication.
233233
*/
234234
public @Nullable Object getPrincipal() {
235235
return getAuthentication().getPrincipal();

core/src/main/java/org/springframework/security/authorization/AuthorityAuthorizationManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ public static <T> AuthorityAuthorizationManager<T> hasScope(String scope) {
168168
*
169169
*/
170170
public static <T> AuthorityAuthorizationManager<T> hasAnyScope(String... scopes) {
171+
Assert.notNull(scopes, "scopes cannot be null");
171172
String[] mappedScopes = new String[scopes.length];
172173
for (int i = 0; i < scopes.length; i++) {
173174
assertScope(scopes[i]);
@@ -189,7 +190,7 @@ private static String[] toNamedRolesArray(String rolePrefix, String[] roles) {
189190
}
190191

191192
private static void assertScope(String scope) {
192-
Assert.notNull(scope, "role cannot be null");
193+
Assert.notNull(scope, "scope cannot be null");
193194
Assert.isTrue(!scope.startsWith("SCOPE_"),
194195
() -> scope + " should not start with SCOPE_ since SCOPE_"
195196
+ " is automatically prepended when using hasScope and hasAnyScope. Consider using "

0 commit comments

Comments
 (0)