How to get the current user

Hi.Can anyone tell me how to get the current user logged in Nuxeo..I am using NuxeoPrincipal but it comes null.I take it this way: @Context NuxeoPrincipal principal

0 votes

1 answers

726 views

ANSWER

In what context do you need the principal? Low-level Java code? Java Operation code? Automation scripting? EL?
10/12/2017

In java Operation code
10/12/2017



May be this way:

    @Context
    protected OperationContext ctx;

   @OperationMethod
    public DocumentModel run(DocumentModel doc) throws Exception {
        Principal principal = ctx.getPrincipal();
    }
0 votes