Share via


ModifyByTemplate Method

Topic Last Modified: 2006-06-13

Performs a specified action on any masks in a DACL object that match any masks of a specified entity in a DACL template object.

Applies To

DACL Object

Syntax


objResult  objDACL.ModifyByTemplate(strName, objDACLTemplate, strNT4NameInDACLTemplate, strAction);

Parameters

  • 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."
  • objDACLTemplate
    A DACL object used as a template.
  • strNT4NameInDACLTemplate
    A string value of the name of an entity in the DACL template object used to compare with the DACL object being evaluated.
  • strAction
    One of the actions described in the following table.

    Action Description of action taken

    Make

    Sets the masks of the DACL object equal to the template DACL object.

    Set

    Bit-wise OR the masks according to the template DACL object.

    Clear

    Bit-wise AND-NOT the masks according to the template DACL object.

Return Value

An object that returns error codes and descriptions.

Remarks

The following possible error messages can be returned:

  • Person not found.
  • Template entity not found.
  • Action parameter not recognized.

Person not found. Template entity not found. Action parameter not recognized.

Example

The following example finds User1 in an objLRoles DACL template object and attempts to clear the reviewer permissions from User1 s masks. The "Reviewer" is an entity in the objLRoles object.

var objLRoles = DaclLegacyRoles();
var objErr = objDacl.ModifyByTemplate("MYDOMAIN\\User1", objLRoles, "Reviewer", "Clear");
if(FAILED(objErr.number)){
   //error handling code.
}