소스 검색

SEC-2930: Update SecurityExpressionOperations javadoc

Rob Winch 10 년 전
부모
커밋
b433cdda7e
1개의 변경된 파일24개의 추가작업 그리고 10개의 파일을 삭제
  1. 24 10
      core/src/main/java/org/springframework/security/access/expression/SecurityExpressionOperations.java

+ 24 - 10
core/src/main/java/org/springframework/security/access/expression/SecurityExpressionOperations.java

@@ -19,8 +19,7 @@ public interface SecurityExpressionOperations {
 
 	/**
 	 * Determines if the {@link #getAuthentication()} has a particular authority within
-	 * {@link Authentication#getAuthorities()}. This is a synonym for
-	 * {@link #hasAuthority(String)}.
+	 * {@link Authentication#getAuthorities()}.
 	 * @param authority the authority to test (i.e. "ROLE_USER")
 	 * @return true if the authority is found, else false
 	 */
@@ -28,27 +27,42 @@ public interface SecurityExpressionOperations {
 
 	/**
 	 * Determines if the {@link #getAuthentication()} has any of the specified authorities
-	 * within {@link Authentication#getAuthorities()}. This is a synonym for
-	 * {@link #hasAnyRole(String...)}.
+	 * within {@link Authentication#getAuthorities()}.
 	 * @param authorities the authorities to test (i.e. "ROLE_USER", "ROLE_ADMIN")
 	 * @return true if any of the authorities is found, else false
 	 */
 	boolean hasAnyAuthority(String... authorities);
 
 	/**
+	 * <p>
 	 * Determines if the {@link #getAuthentication()} has a particular authority within
-	 * {@link Authentication#getAuthorities()}. This is a synonym for
-	 * {@link #hasAuthority(String)}.
-	 * @param authority the authority to test (i.e. "ROLE_USER")
+	 * {@link Authentication#getAuthorities()}.
+	 * </p>
+	 * <p>
+	 * This is similar to {@link #hasAuthority(String)} except that this method implies
+	 * that the String passed in is a role. For example, if "USER" is passed in the
+	 * implementation may convert it to use "ROLE_USER" instead. The way in which the role
+	 * is converted may depend on the implementation settings.
+	 * </p>
+	 *
+	 * @param authority the authority to test (i.e. "USER")
 	 * @return true if the authority is found, else false
 	 */
 	boolean hasRole(String role);
 
 	/**
+	 * <p>
 	 * Determines if the {@link #getAuthentication()} has any of the specified authorities
-	 * within {@link Authentication#getAuthorities()}. This is a synonym for
-	 * {@link #hasAnyAuthority(String...)}.
-	 * @param authorities the authorities to test (i.e. "ROLE_USER", "ROLE_ADMIN")
+	 * within {@link Authentication#getAuthorities()}.
+	 * </p>
+	 * <p>
+	 * This is a similar to hasAnyAuthority except that this method implies
+	 * that the String passed in is a role. For example, if "USER" is passed in the
+	 * implementation may convert it to use "ROLE_USER" instead. The way in which the role
+	 * is converted may depend on the implementation settings.
+	 * </p>
+	 *
+	 * @param authorities the authorities to test (i.e. "USER", "ADMIN")
 	 * @return true if any of the authorities is found, else false
 	 */
 	boolean hasAnyRole(String... roles);