on 03-06-2007 6:52 PM
I would like to populate a drop down box with the roles from the UserManagement. I am using the PDK for .Net 2.5 with EP 6.0 SP19. Could someone help me get started?
Thanks for the input. I am very familiar with the reference material but was looking for a little more help. Here is what I have. I get an error that says "Could not find a role with the unique name NA". I am trying to get all the roles with 'NA' in their name. Any help would be appreciated.
Public Sub FillDropDownList()
Dim ddli As New DropDownListItem
ddli.Text = "Please select a role"
ddli.Key = "0"
ddkRolesList.Items.Add(ddli)
Dim objUserManagement As New UserManagement()
Dim portalroles As Array
portalroles = objUserManagement.SearchRoles("NA", 1, False, 0)
Dim role As String
For Each role In portalroles
Dim rInfo As RoleInfo = objUserManagement.GetRoleByUniqueName(role)
Dim rName As String = rInfo.DisplayName
ddli = New DropDownListItem
ddli.Text = rName
ddli.Key = role
ddkRolesList.Items.Add(ddli)
Next role
End Sub
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gabe,
how are you doing ?
the search mechanism exposed by the API is similar to what would happen when you execute it from User Administration within portal, see if you get the same error message from the Admin UI, most likely it should be the same. [remember to log on as the same user, as all reads are dependant on the priviliges associated to the current user's roles, groups, etc ...]
it will search for a role with the exact name 'NA' [this is case sensitive]
what you could try is expand the query to : "NA", or something similar to what is accurate to your requirement
also ensure that the current user [executing the query] has read permissions on the directory that your role is stored in [within the PCD]
with respect,
amit
Hi Gabe,
thank you for the 'solved problem' reward points
with respect,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gabe,
Currently 2 portal services are exposed in the .NET PDK,
User Management is one of them
Add a reference to u're project to : SAP.Portal.Services.UserManagement.dll
RoleInfo is the class you need
the link will give you info on the Class : Role Info
with respect,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gabe
Please check this link.
<a href="https://media.sdn.sap.com/html/submitted_docs/dotnet/How%20to/User.IsInRole%20Method.htm">User Role Checking</a>
Regards
Geogi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.