config/src/main/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurer.java
private static String hasRole(String role) {
		Assert.isTrue(
				!role.startsWith("ROLE_"),
				() -> role
						+ " should not start with ROLE_ since ROLE_ is automatically prepended when using hasRole. Consider using hasAuthority or access instead.");
		return "ROLE_" + role;
	}
private static String hasRole(String role) {
		Assert.isTrue(
				!role.startsWith("ROLE_"),
				() -> role
						+ " should not start with ROLE_ since ROLE_ is automatically prepended when using hasRole. Consider using hasAuthority or access instead.");
		return "ROLE_" + role;
	}
private static String hasRole ( String role ) { Assert . isTrue ( ! role . startsWith ( "ROLE_" ) , ( ) -> role + " should not start with ROLE_ since ROLE_ is automatically prepended when using hasRole. Consider using hasAuthority or access instead." ) ; return "ROLE_" + role ; }
Creates a String for specifying a user requires a role.

@param role the role that should be required which is prepended with ROLE_
automatically (i.e. USER, ADMIN, etc). It should not start with ROLE_
@return the {@link ConfigAttribute} expressed as a String
Creates a String for specifying a user requires a role .