Developer Documentation Library > Interviewer - Server Admin > Customizing UNICOM Intelligence Interviewer - Server Admin > Adding activities to UNICOM Intelligence Interviewer - Server Admin > Common tasks in activity development > Adding roles to projects or activities
 
Adding roles to projects or activities
If you are customizing UNICOM Intelligence Interviewer - Server Admin, you might want your program to add roles to projects or activities, instead of having the administrator do this manually. The DPM Explorer sample tool that is supplied with source code as part of the UNICOM Intelligence Developer Documentation Library show how to do this by using Visual Basic .NET.
The statements you need to include in your program are as follows:
Dim oAccessCtrl As SPSSMR.DPM.Security.Authorization.IAccessControl
oAccessCtrl = DirectCast(oDPMObject, SPSSMR.DPM.Security.Authorization.IAccessControl)
oAccessCtrl.AddAuthorizedRole(<value>)
In these statements, oDPMObject is a Project or Application object, and Value is the role to be assigned.
For a complete example, see the Add_Role_Click() function in the source code for DPM Explorer. This source code is in the Code\Tools\VB.NET\DPM Explorer.Net\frmMain.vb file, which is in the same folder as the UNICOM Intelligence Developer Documentation Library.
See also
Common tasks in activity development