ISProvider.AddRoles

Description

This function adds new roles with the specified role names to the provider.

Syntax

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

Return Value

bool

Returns True if the roles list was successfully added, otherwise returns False.

Example

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)  
Note:

In Profile Client v8 on User Interface Roles can be found and added in Organisation > People&Places > People and Places > Open the selected Provider > Roles > Privacy rights list.

Version information

Added in v7.8.0