public static Access datasourceAuthorizationCheck ( final HttpServletRequest req , Action action , String datasource , AuthorizerMapper authorizerMapper ) { ResourceAction resourceAction = new ResourceAction ( new Resource ( datasource , ResourceType . DATASOURCE ) , action ) ; Access access = AuthorizationUtils . authorizeResourceAction ( req , resourceAction , authorizerMapper ) ; if ( ! access . isAllowed ( ) ) { throw new ForbiddenException ( access . toString ( ) ) ; } return access ; }
Authorizes action to be performed on a task s datasource