IAccessControlList.Assign

Syntax

Assign(Source: IAccessControlList);

Parameters

Source. Source object access control elements.

Description

The Assign method replaces list elements with element from another list.

Example

Executing the example requires that the repository contains an object with the OBJ1 and OBJ2 identifiers.

Add a link to the Metabase system assembly.

Sub UserProc;
    Var
        MB: IMetabase;
        ObjDesc: IMetabaseObjectDescriptor;
        ObjDesc2: IMetabaseObjectDescriptor;
        SecDesc: ISecurityDescriptor;
        SecDesc2: ISecurityDescriptor;
        AcessCL: IAccessControlList;
        AcessCL2: IAccessControlList;
    Begin
        MB:=MetabaseClass.Active;
        ObjDesc:=MB.ItemById("OBJ1");
        SecDesc:=ObjDesc.SecurityDescriptor;
        SecDesc.Edit;
        AcessCL:=SecDesc.Acl;
        ObjDesc2:=MB.ItemById("NSI");
        SecDesc2:=ObjDesc2.SecurityDescriptor;
        AcessCL2:=SecDesc2.Acl; 
        AcessCL.Assign(AcessCL2);
        SecDesc.Apply(True);
End Sub UserProc;

After executing the example the OBJ1 access control list elements are replaced with the OBJ2 access control list elements.

See also:

IAccessControlList