Share via


HasMaskByTemplate Method (Entity Object)

Topic Last Modified: 2006-06-13

Determines if an entity object has the masks of a specified entity in a DACL template object.

Applies To

Entity Object

Syntax


objResult  objEntity.HasMaskByTemplate(strName, ObjDaclTemplate);

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 to compare with the entity object.

Return Value

An object that returns error codes and descriptions.

Remarks

Returns TRUE if one or more masks in the entity object are matched with DACL template object.

This method is useful for determining if a user, the entity object, has a particular right the masks of a specified entity.

Example

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

// Returns the predefined DACL with the MAPI roles
var objMapiRoles = DaclLegacyRoles();   
if(e.HasMaskByTemplate("Owner", objMapiRoles)) {

// User has that MAPI role
}