SecurityDescriptor: ISecurityDescriptor;
The SecurityDescriptor property returns the control parameters of access to the current object.
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(True);
End Sub Main;
The user is added to the specified object after executing this example. Permissions in accordance with the "131071" mask (Full Access) are set for it in additional parameters.
See also: