Dovico.TrackITAPI.CSecurity.ApplyPermissions(System.String,Dovico.TrackITAPI.CStateInfo)
Function Overview:
Call this method to apply permissions to a security object or a group. The permissions are specified in applypermissions.xsd format. IMPORTANT: Note that all permissions for the object must be specified because all existing permissions are deleted prior to the application of these permissions. If the permissions tag is left empty, all permissions for the object will be removed.
Parameter List:
sXml - string - permission information in the format applypermissions.xsd. If permissions are being applied to a security group then the TARGET should be GROUP and the TARGETID should be the group id, each individual permission should have the security object id and the access level. If permissions are being applied to a security object then the TARGET should be OBJECT and the TARGETID should be the security object id, each individual permission should have the group id and the access level.
siState - CStateInfo - state information needed to process a transaction
Returns
An empty string (reserved for future use).
Example:
// build up xml to apply permissions to a security group
// (Note that permissions may also be applied for many groups on a
// security object as well by changing the TARGET attribute)
string sXml = "<ApplyPermissions:APPLYPERMISSIONS xmlns:ApplyPermissions=\"http://www.dovico.com/schemas/applypermissions.xsd\" ";
sXml += "TARGET=\"GROUP\" TARGETID=\"1002\"><PERMISSIONS>";
sXml += "<PERMISSION ID=\"150\" ACCESS=\"1\"/><PERMISSION ID=\"151\" ACCESS=\"2\"/>";
sXml += "</PERMISSIONS></ApplyPermissions:APPLYPERMISSIONS>";
wsapi.MethodInvoke("SecurityApplyPermissions", sXml, stToken);