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 OBJECT identifier. The USER user is created in the security manager.
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);
// Get object
ObjDesc := MB.ItemById("OBJECT");
SecDesc := ObjDesc.SecurityDescriptor;
Subject := MB.Security.ResolveName("USER");
SecDesc.Edit;
// Allow full access of user to object
AcessCL := SecDesc.Acl;
AcessCL.AddAce(AceType.AccessAllowed, Subject.Sid, MetabaseObjectPredefinedRights.All);
SecDesc.Apply(True);
// Check in license
Lic := Null;
End Sub UserProc;
The user is added to the specified object after executing this example. The user is allowed full access in advanced security parameters.
See also: