use of io.jmix.graphql.controller.GraphQLControllerException in project jmix by jmix-framework.
the class FilePermissionService method checkFileDownloadPermission.
public void checkFileDownloadPermission() {
GraphQLAccessContext downloadContext = new GraphQLAccessContext(GraphQLAccessContext.GRAPHQL_FILE_DOWNLOAD_ENABLED);
accessManager.applyRegisteredConstraints(downloadContext);
if (!downloadContext.isPermitted()) {
throw new GraphQLControllerException("File download failed", "File download is not permitted", HttpStatus.FORBIDDEN);
}
}
Aggregations