Edit;
The Edit method opens the object security parameters for editing.
After making the changes, use the Apply method to save them, use the Revert method to cancel changes.
Executing the example requires that the repository contains an object with the Obj_1 identifier.
Sub Main;
Var
MB: IMetabase;
ObjDesc: IMetabaseObjectDescriptor;
SecDesc: ISecurityDescriptor;
AcessCL: IAccessControlList;
ACE: IAccessControlEntry;
Sec: IMetabaseSecurity;
SS: ISecuritySubject;
Sid: ISid;
Begin
MB := MetabaseClass.Active;
ObjDesc := MB.ItemById("Obj_1");
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.Apply(False);
End Sub Main;
After executing the example the user is added to the access control parameters for the specified object. Permissions in accordance with the "131071" mask (Full Access) are set for it in additional parameters. These changes are applied only for the specified object.
See also: