ISecurityDescriptor.ApplyO

Syntax

ApplyO(Options: SecurityDescriptorApplyFlags);

Parameters

Options. Element of the SecurityDescriptorApplyFlags enumeration that determines the way rights to a current object will be applied.

Description

The ApplyO method escapes from the edit mode saving changes of the object security parameters and determines if the new security parameters are applied for the internal objects and for objects, for which the indicator of deferred description loading was set.

Comments

An example of an inner object is an inner model that is included in a chain of metamodel calculation. An example of creation of an inner model is in description of the IMsCalculationChainEntries.AddExclusiveModel method.

Applying rights by hierarchy rights on inner objects and objects the mark deferred description loading is assigned are not applied.

Example

Executing the example requires that the repository contains an object that includes inner objects (for example, modeling container) with the Obj1 identifier. Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    ObjDesc: IMetabaseObjectDescriptor;
    SecDesc: ISecurityDescriptor;
    AcessCL: IAccessControlList;
    ACE: IAccessControlEntry;
    Sec: IMetabaseSecurity;
    SS: ISecuritySubject;
    Sid: ISid;
Begin
    MB := MetabaseClass.Active;
    ObjDesc := MB.ItemById("Obj1");
    SecDesc := ObjDesc.SecurityDescriptor;
    Sec := MB.Security;
    SS := Sec.AllUsers.Item(10);
    Sid := SS.Sid;
    SecDesc.Edit;
    AcessCL := SecDesc.Acl;
    ACE := AcessCL.AddAce(AceType.AccessAllowed, Sid, 131071);

    SecDesc.ApplyO(SecurityDescriptorApplyFlags.ToInternal);
End Sub UserProc;

After executing this example the user is added in parameters of access control for a specified object and for all inner objects. Permissions in accordance with the quot;131071quot; mask (Full Access) are set for it in additional parameters. These changes are applied for a specified object and for inner objects included in it.

See also:

ISecurityDescriptor