다음을 통해 공유


SetByTemplate Method (Entity Object)

Topic Last Modified: 2006-06-13

Adds masks to an entity object from a specified entity in a DACL template object.

Applies To

Entity Object

Syntax


objResult  objEntity.SetByTemplate(objDACLTemplate, strName);

Parameters

  • objDACLTemplate
    A DACL object used as a template.
  • strName
    A string value of an entity to match in the DACL template. This value can either be the domain and username of a user or group, or a predefined role such as an "Author."

Return Value

An object that returns error codes and descriptions.

Example

var e = objDacl.SearchForObjectByNT4Name("MyDomain\\User1");

// Returns the predefined DACL with the MAPI roles
var objMapiRoles = DaclLegacyRoles();   
objResult = e.SetByTemplate(objMapiRoles, "Owner",);
if(FAILED(objResult.number)){
    
// Print the error message stored in objResult.description
}