This discussion is archived
2 Replies Latest reply: Mar 1, 2013 2:19 AM by user243865 RSS

Custom Report: the list of IT ROLES of one or more users

gentjan Newbie
Currently Being Moderated
Hi all,

I want to do a custom report that gives me the list of IT ROLES of one or more users. Anyone could give me some guidelines?

Thanks
  • 1. Re: Custom Report: the list of IT ROLES of one or more users
    gentjan Newbie
    Currently Being Moderated
    I can get all the roles in the system using the following line:
    List allRoles = com.waveset.ui.FormUtil.getRoles(_ctx, "accountId");

    I want to get just the IT Roles that i have assigned to accountId. How to get that?
  • 2. Re: Custom Report: the list of IT ROLES of one or more users
    user243865 Newbie
    Currently Being Moderated
    according to the docs... if I interpret them right

    getRoles returns roles assigned to the context given, this is wise since it is usualy used to check if the current user invoking the call has the rights in a form, workflow or similiar...

    Adding the "accountId" string as a second argument would invoke this form of the getRoles
    ---
    getRoles
    public static java.util.List getRoles(LighthouseContext s, java.lang.String current) throws WavesetException

    This variant allows a specific name to be included in the returned list. Used to ensure that the current value of a role may continue to be assigned even though the current admin may not have access to that role.
    ---

    I believe you should get the users view and get your info from there...
    if you try using the debug page and getObject User and the accountId, you will see the user in its full glory...
    there you can see what you might want to do I hope

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points