public boolean isUserAuthorized ( String requestId , String userId , SingularityAuthorizationScope scope ) { final Function < String , String > requestUri = ( host ) - > String . format ( AUTH_CHECK_USER_FORMAT , getApiBase ( host ) , requestId , userId ) ; Map < String , Object > params = Collections . singletonMap ( "scope" , scope . name ( ) ) ; HttpResponse response = executeGetSingleWithParams ( requestUri , "auth check" , "" , Optional . of ( params ) ) ; return response . isSuccess ( ) ; }
Check if a user is authorized for the specified scope on the specified request