Add hasAnyAuthority method in AuthorizePayloadsSpec.Access
See Fixes gh-7437 Co-authored-by: Eddú Meléndez <eddu.melendez@gmail.com>
This commit is contained in:
@@ -104,6 +104,7 @@ import java.util.List;
|
||||
* }
|
||||
* </pre>
|
||||
* @author Rob Winch
|
||||
* @author Ebert Toribio
|
||||
* @since 5.2
|
||||
*/
|
||||
public class RSocketSecurity {
|
||||
@@ -320,6 +321,10 @@ public class RSocketSecurity {
|
||||
.just(new AuthorizationDecision(true)));
|
||||
}
|
||||
|
||||
public AuthorizePayloadsSpec hasAnyAuthority(String... authorities) {
|
||||
return access(AuthorityReactiveAuthorizationManager.hasAnyAuthority(authorities));
|
||||
}
|
||||
|
||||
public AuthorizePayloadsSpec access(
|
||||
ReactiveAuthorizationManager<PayloadExchangeAuthorizationContext> authorization) {
|
||||
AuthorizePayloadsSpec.this.authzBuilder.add(new PayloadExchangeMatcherEntry<>(this.matcher, authorization));
|
||||
|
||||
Reference in New Issue
Block a user