This function adds new roles with the specified role names to the provider.
object.AddRoles(aMsgText,
aRoleNames)
Part | Attribute | Type | Description |
---|---|---|---|
object |
Required | The object always implements the
ISProvider interface |
|
aMsgText |
In/Out, Required | object& |
Returns text information about possible errors
|
aRoleNames |
In, Required | string |
Comma-separated role names list |
bool
Enter the data through the user dialog, add new role to the provider and display the result.
Dim aDialog, aProviderCodeControl, aRolesListControl
Dim aProviderCode, aRolesList
Dim aResult, aAddingResult
Dim aProvider
Dim aMessage, aMsgTextResult
set aDialog = Profile.CreateDialog("Enter the provider code and roles")
set aProviderCodeControl = aDialog.AddControl("Provider Code", 2, "PROV") ' sctEdit
set aRolesListControl = aDialog.AddControl("Roles", 2, "General") ' sctEdit
aResult = aDialog.Execute
if not aResult then exit sub
aRolesList = aRolesListControl.Text
aProviderCode = aProviderCodeControl.Text
set aProvider = Profile.LoadProvider(aProviderCode)
if aProvider.Id = 0 then
Profile.MsgBox("Provider with the code '" & aProviderCode & "' doesn't exist")
exit sub
end if
aMessage = aProvider.FullName
aMsgTextResult = ""
aAddingResult = aProvider.AddRoles(aMsgTextResult, aRolesList)
aProvider.Save
aMessage = aMessage & vbNewLine &_
" Roles were added: " & aResult & ". Additional Info: " & aMsgTextResult
Profile.MsgBox (aMessage)
In Profile Client v8 on User Interface Roles can be found and added in
.