Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: for the plan.

Jump to: navigation, search

Stardust/Knowledge Base/API/JavaAPICookbook/CheckingUserSpecificRole

< Stardust‎ | Knowledge Base
Revision as of 05:37, 19 March 2014 by (Talk | contribs) ()

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


There are instances where you need to find if a particular user is assigned under a specific role.You don't have to iterate over a list of grants to achieve this.


QueryService qs = sf.getQueryService();
UserQuery userQuery = new UserQuery();
userQuery.getFilter().add(UserQuery.ACCOUNT.isEqual("Bang")); //User
ParticipantInfo pInfo = qs.getParticipant("Administrator"); //Role, This can be model specific
User retUser = qs.findFirstUser(userQuery);
System.out.println("retUser:::::::::" + retUser);

Back to the top