IMetabaseObjectDescriptor.GetSecurity

Syntax

GetSecurity: IAccessObjectSecurity;

GetSecurity(): Prognoz.Platform.Interop.Metabase.IAccessObjectSecurity;

Description

The GetSecurity method gets the access policy of the object. Receive of the users/groups, access elements and rights by elements is meant.

Example

Executing the example requires that the repository contains the ObjTest MDM dictionary. The "Change of the security label and of the access control list of any object" privilege should be given to the user who executes the example.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    Object: IMetabaseObjectDescriptor;
    SD: ISecurityDescriptor;
    AOS: IAccessObjectSecurity;
Begin
    MB := MetabaseClass.Active;
    Object := MB.ItemById("ObjTest");
    SD := Object.SecurityDescriptor;
    If SD.AccessSecured Then
        AOS := Object.GetSecurity;
        AOS.RevokeAccessSecured;
    End If;
End Sub UserProc;
Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Object: IMetabaseObjectDescriptor;
    SD: ISecurityDescriptor;
    AOS: IAccessObjectSecurity;
Begin
    MB := Params.Metabase;
    Object := MB.ItemById["ObjTest"];
    SD := Object.SecurityDescriptor;
    If SD.AccessSecured Then
        AOS := Object.GetSecurity();
        AOS.RevokeAccessSecured();
    End If;
End Sub;

After executing the example the use of the access permissions is disabled for the MDM dictionary, if it was enabled before.

See also:

IMetabaseObjectDescriptor