IMetabaseUpdateAccessSubject.RemappingSid

Syntax

RemappingSid: ISid;

Description

The RemappingSid property returns the appropriate identifier of the security subject on applying the update.

Example

To execute the example, add links to the Metabase, Collections and Stat system assemblies. The C:\Update.pefx update file is required.

Sub main;
Var
    Mb: IMetabase;
    Upd: IMetabaseUpdate;
Begin   
    MB := MetabaseClass.Active;
    Upd := Mb.CreateUpdate;
    Upd.LoadFromFileNF("D:\Update.pefx");
    Upd.Prepare;
    updateprepare(Upd);
    Upd.SaveAvailable("D:\Update.pefx");
End Sub main;

Sub updateprepare (update: IMetabaseUpdate);
    Var
    mbuss: IMetabaseUpdateAccessSubjects;
    mbus: IMetabaseUpdateAccessSubject;
    Upd: IMetabaseUpdate;
    i: Integer;
    Begin
    Upd := update;
    mbuss := Upd.Subjects;
    For i:=0 To mbuss.Count - 1 Do
        mbus := mbuss.Item(i);
        debug.WriteLine("Appropriate sid of the user:  "+mbus.RemappingSid.AsString);
        debug.WriteLine("Alternative sid of the user (search by name, if the subject was not found by sid):  "+mbus.AlternativeSid.AsString);    
        If mbus.AlternativeSid.AsString = "" Then
            If mbus.RemappingSid.AsString <> "" Then
                debug.WriteLine(mbuss.FindBySidString(mbus.RemappingSid.AsString).Name);
            Else debug.WriteLine("New user: "+mbus.Name +" Sid: "+mbus.Sid.AsString);
            End If
        End If;
    End For;

    debug.WriteLine("Updating of users is required:  "+Upd.RequireUserUpdateMessage.ToString);
End Sub updateprepare;

After executing the example the console window displays the message containing information about the security subjects, for which access permissions will be updated.

See also:

IMetabaseUpdateAccessSubject