IMetabaseUpdateSecuritySubjectNode.Subject

Syntax

Subject: ISecuritySubject;

Subject: Prognoz.Platform.Interop.Metabase.ISecuritySubject;

Description

The Subject property determines security subject that data are necessary to add in update.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MU: IMetabaseUpdate;
    SubNode: IMetabaseUpdateSecuritySubjectNode;
    Sec: IMetabaseSecurity;
    Subj: ISecuritySubject;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    MU := MB.CreateUpdate;
    Sec := MB.Security;
    
For i := 0 To Sec.Users.Count - 1 Do
        Subj := Sec.Users.Item(i);
        SubNode := MU.RootFolder.Add(MetabaseUpdateNodeType.SecuritySubject) 
As IMetabaseUpdateSecuritySubjectNode;
        SubNode.Label := Subj.Name;
        SubNode.Subject := Subj;
    
End For;
    MU.SaveToFileNF(
"C:\User_Update.pefx");
End Sub UserProc;

Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MU: IMetabaseUpdate;
    SubNode: IMetabaseUpdateSecuritySubjectNode;
    Sec: IMetabaseSecurity;
    Subj: ISecuritySubject;
    i: Integer;
Begin
    MB := Params.Metabase;
    MU := MB.CreateUpdate();
    Sec := MB.Security;
    
For i := 0 To Sec.Users.Count - 1 Do
        Subj := Sec.Users.Item[i];
        SubNode := MU.RootFolder.Add(MetabaseUpdateNodeType.untSecuritySubject) 
As IMetabaseUpdateSecuritySubjectNode;
        SubNode.Label := Subj.Name;
        SubNode.Subject := Subj;
    
End For;
    MU.SaveToFileNF(
"C:\" + "User_Update.pefx");
End Sub;

After executing the example, a new update is created, which includes all users of the current repository. The update is saved to the User_Update.pefx file.

See also:

IMetabaseUpdateSecuritySubjectNode