Sid: ISid;
The Sid property returns parameters of the identifier of the security subject.
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. In additional security parameters the user is assigned with permissions in accordance with mask "131071" (Complete access).
See also: