How Can I know the current user is or is not the owner of the gadget?

xu zhijian November 14, 2011

How Can I know the current user is or is not the Owner of the gadget ? Or , How i get the current user , or How can i get the owner of the gadget ? ? Thanks .

1 answer

1 accepted

1 vote
Answer accepted
Mikael Löwenadler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 14, 2011

Current user :

com.atlassian.crowd.embedded.api.User user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();

Not sure what you mean by gadget owner.

xu zhijian November 15, 2011

Thanks, i set an args key:user, ajaxOptions return /rest/gadget/1.0/currentUser , and i can use args.user[username] to fetch current username .

Suggest an answer

Log in or Sign up to answer