ApplyO(Options: SecurityDescriptorApplyFlags);
Options. Element of the SecurityDescriptorApplyFlags enumeration that determines how permissions will be applied to the current object.
The ApplyO method exits from the edit mode with saving changes of the object security parameters and determines whether the new security parameters are applied for internal objects and for objects, for which lazy loading of description was set.
An example of an internal object is an internal model that is included in a chain of metamodel calculation. An example of creation of an internal model is in description of the IMsCalculationChainEntries.AddExclusiveModel method.
When applying permissions by hierarchy, permissions on internal objects and objects, for which lazy loading of description is set, are not applied.
To execute the example, make sure that the security manager contains the USER user, the object navigator contains an object with the OBJECT identifier. The object contains child objects.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
ObjDesc: IMetabaseObjectDescriptor;
SecDesc: ISecurityDescriptor;
AcessCL: IAccessControlList;
Subject: ISecuritySubject;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Get license to be able to work with the security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
ObjDesc := MB.ItemById("OBJECT");
SecDesc := ObjDesc.SecurityDescriptor;
Subject := MB.Security.ResolveName("USER");
SecDesc.Edit;
AcessCL := SecDesc.Acl;
AcessCL.AddAce(AceType.AccessAllowed, Subject.Sid, MetabaseObjectPredefinedRights.All);
SecDesc.ApplyO(SecurityDescriptorApplyFlags.ToInternal);
// Check in license
Lic := Null;
End Sub UserProc;
After executing the example the user is added in parameters of access control for the specified object and for all child objects. Full access is allowed for the object in advanced security parameters.
See also: