Webengine - Override security policies

Hi,

I developed a site “WebEngine” which gives access to a specific document type in Nuxeo with a url like “http://localhost:8080/nuxeo/site/depfile/a0454535-107a-43ee-9c4d-75a392d73b85/“.

I would like to override the security rights that anyone can read the document where it is on Nuxeo?

Or otherwise use “admin” account to be able to do?

Here is an excerpt of my code:

 @GET
 @Path("/{key}/")
 public Object getContenu(@PathParam("key") String key) {
     ctx.setProperty("key", key);
     String query = "SELECT * FROM Document WHERE ecm:uuid = '" + key + "' AND ecm:primaryType = 'FileShare'";
    try {
        DocumentModelList doc = ctx.getCoreSession().query(query);
        return getView("index").arg("Document", doc);
    } catch (ClientException e) {
        throw WebException.wrap(e);
    }
  }
 }
0 votes

0 answers

688 views

ANSWER