IMetabaseSecurity.ResolveSid

Syntax

ResolveSid(Sid: ISid): ISecuritySubject;

ResolveSid(Prognoz.Platform.Interop.Metabase.MetabaseSid): Prognoz.Platform.Interop.Metabase.ISecuritySubject;

Parameters

Sid. Security subject identifier.

Description

The ResolveSid method returns parameters of security subject, which identifier is passed as the Sid parameter.

Comments

If the security subject does not exist, the method returns Null.

Example

To execute the example, make sure that the repository contains an object with the Obj_1 identifier.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    Sec: IMetabaseSecurity;
    SecDesc: ISecurityDescriptor;
    Acl: IAccessControlList;
    Ace: IAccessControlEntry;
    Subject: ISecuritySubject;
Begin
    MB := MetabaseClass.Active;
    Sec := MB.Security;
    SecDesc := MB.ItemById(
"Obj_1").SecurityDescriptor;
    Acl := SecDesc.Acl;
    
For Each Ace In Acl Do
        Subject := Sec.ResolveSid(Ace.Sid);
        
If Ace.Type = AceType.AccessAllowed Then
            Debug.Write(
"Permissive parameter. Access mask: " + Ace.AccessMask.ToString);
            Debug.WriteLine(
"; Security subject:" + Subject.Name);
        
Else
            Debug.Write(
"Prohibitive parameter. Access mask: " + Ace.AccessMask.ToString);
            Debug.WriteLine(
"; Security subject: " + Subject.Name);
        
End If;
    
End For;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Sec: IMetabaseSecurity;
    SecDesc: ISecurityDescriptor;
    Acl: IAccessControlList;
    Ace: IAccessControlEntry;
    Subject: ISecuritySubject;
Begin
    MB := Params.Metabase;
    Sec := MB.Security;
    SecDesc := MB.ItemById[
"Obj_1"].SecurityDescriptor;
    Acl := SecDesc.Acl;
    
For Each Ace In Acl Do
        Subject := Sec.ResolveSid(Ace.Sid);
        
If Ace.Type = AceType.aceAccessAllowed Then
            System.Diagnostics.Debug.Write(
"Permissive parameter. Access mask: " + Ace.AccessMask.ToString());
            System.Diagnostics.Debug.WriteLine(
"; Security subject:" + Subject.Name);
        
Else
            System.Diagnostics.Debug.Write(
"Prohibitive parameter. Access mask: " + Ace.AccessMask.ToString());
            System.Diagnostics.Debug.WriteLine(
"; Security subject: " + Subject.Name);
        
End If;
    
End For;
End Sub;

After executing the example the development environment console displays information about additional parameters of the Obj_1 object security. Information about the security subject, for which the specified parameter is added, is obtained by the security subject identifier.

See also:

IMetabaseSecurity