How to get user roles

Hello,

I have try to get logged in Users role with the help of this page detail : http://telligent.com/community/developers/w/developer6/20564.aspx.

But when execute this below lines with my userid-

var requestUrl = "XYZ.com/api.ashx/v2/roles/permissions/user/{userid}.xml (or .json)

var xml = webClient.DownloadString(requestUrl);

it throws error- "Unable to connect to the remote server"

can anyone please help me to sort it out.

Thanks

Parimal Patel

  • In reply to Luke D:

    I've written you an working widget example. See below.

    You really should read the documentation:

    http://community.zimbra.com/developers/w/developer7/28599.core-v2-role-widget-extension

    #set($apiListResponse = $core_v2_role.List("%{Username = 'admin'}"))

    <h2>Roles for Admin</h2>

    <ul>
    #foreach($role in $apiListResponse)
    #each
    <li>$role.Name</li>
    #end
    </ul>

Related