Acl: IAccessControlList;
Acl: Prognoz.Platform.Interop.Metabase.IAccessControlList;
The Acl property returns a list of access control to the object saved in update.
Relevant on using the discretionary method of the access control. Conditions for using the property:
The IMetabaseUpdateObjectNode.UpdatePart property is set to ReplaceSecurityDescriptor.
The list of access control is specified.
If the specified conditions are met, the Acl property enables the change of object access control parameter. Changed parameters will be saved in update.
Access control parameters will be copy from the initial object (IMetabaseObjectDescriptor->SecurityDescriptor->Acl), if at least one condition is met.
Executing the example requires that the repository contains objects with the OBJ1 and OBJ2 identifiers. Add a link to the Metabase system assembly.
Sub UserProc;
Var
Mb: IMetabase;
Obj: IMetabaseObjectDescriptor;
Upd: IMetabaseUpdate;
Nd: IMetabaseUpdateObjectNode;
RootFolder: IMetabaseUpdateFolderNode;
ObjDesc: IMetabaseObjectDescriptor;
SecDesc: ISecurityDescriptor;
AcessCL: IAccessControlList;
Begin
Mb := MetabaseClass.Active;
ObjDesc := MB.ItemById("OBJ1");
SecDesc := ObjDesc.SecurityDescriptor;
AcessCL := SecDesc.Acl;
Upd := Mb.CreateUpdate;
RootFolder := Upd.RootFolder;
Nd := RootFolder.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
Upd.AllowReplaceSD := True;
Nd.UpdatePart := MetabaseObjectUpdatePart.ReplaceSecurityDescriptor;
Obj := Mb.ItemById("OBJ2").Bind;
Nd.Object := Obj;
Nd.Acl.Append(AcessCL);
Upd.SaveToFileNF("C:\Update.pefx");
Upd := Mb.CreateUpdate;
Upd.LoadFromFileNF("C:\Update.pefx");
Upd.Apply;
End Sub UserProc;
During the execution of the example the created update is installed. After executing the example the additional security parameters of the repository object with the OBJ2 identifiers will be replaced by OBJ1 additional parameters.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Metabase;
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
Obj: IMetabaseObjectDescriptor;
Upd: IMetabaseUpdate;
Nd: IMetabaseUpdateObjectNode;
RootFolder: IMetabaseUpdateFolderNode;
ObjDesc: IMetabaseObjectDescriptor;
SecDesc: ISecurityDescriptor;
AcessCL: IAccessControlList;
Begin
Mb := Params.Metabase;
ObjDesc := MB.ItemById["OBJ1"];
SecDesc := ObjDesc.SecurityDescriptor;
AcessCL := SecDesc.Acl;
Upd := Mb.CreateUpdate();
RootFolder := Upd.RootFolder;
Nd := RootFolder.Add(MetabaseUpdateNodeType.untObject) As IMetabaseUpdateObjectNode;
Upd.AllowReplaceSD := True;
Nd.UpdatePart := MetabaseObjectUpdatePart.moupReplaceSecurityDescriptor;
Obj := Mb.ItemById["OBJ2"].Bind();
Nd.Object := Obj;
Nd.Acl.Append(AcessCL);
Upd.SaveToFileNF("C:\" + "Update.pefx");
Upd := Mb.CreateUpdate();
Upd.LoadFromFileNF("C:\" + "Update.pefx", UpdateLoadMode.ulmReplace);
Upd.Apply(Null);
End Sub;
See also: