Upload File using Files Rest API

2024-02-23T00:09:37.525+08:00 DEBUG 23608 — [nio-8082-exec-4] io.jmix.core.AccessLogger : Denied access to [rest.fileUpload.enabled] for user [anonymous] by io.jmix.security.impl.constraint.SpecificConstraintImpl
2024-02-23T00:09:37.526+08:00 INFO 23608 — [nio-8082-exec-4] i.j.r.i.c.RestControllerExceptionHandler : RestAPIException: File upload failed, File upload is not permitted

I got this when I tried to upload file as anonymous. I have already added the jmix.rest.anonymous-url-patterns /rest/files in application.properties but got upload file failed. is there any workaround for this.

Hi,

Denied access to [rest.fileUpload.enabled] for user [anonymous] by io.jmix.security.impl.constraint.SpecificConstraintImpl

This message says that the user doesn’t have a role that contains a rest.fileUpload.enabled specific policy.

You need to create a role which contains this specific policy and assign this role to the user.