Hey Everyone,
Can anyone tell me how to access black pearl "roles" through code. ?. I need to create a function which accepts role name and then gives back collection of username?
Thanks in advance
Hey Everyone,
Can anyone tell me how to access black pearl "roles" through code. ?. I need to create a function which accepts role name and then gives back collection of username?
Thanks in advance
Hi,
I would recommend you to do this through a SmartObject using the URM(UserRoleManager) ServiceObject, but you could also do this through the URM API as described below.
You need to reference the following assemblies :
The following is a very simple example on how to use the API:
UserRoleManagerServer urm = new UserRoleManagerServer();
urm.Connection = urm.CreateConnection();
//To build up the connection string.
SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder csb = new SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder();
csb.Host = "blackpearl";
csb.Integrated = true;
csb.IsPrimaryLogin = true;
csb.Port = 5555;
//Open the connection using the constr built
urm.Connection.Open(csb.ToString());
//Get a collection of users belonging to a Role
SourceCode.Hosting.Server.Interfaces.IUserCollection users = urm.ResolveQueue("MyRole");
//...Rest of code here
Hope this helps.
Gert
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.