RemappingSid: ISid;
RemappingSid: Prognoz.Platform.Interop.Metabase.ISid;
The RemappingSid property returns the appropriate identifier of the security subject on applying the update.
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 users is required: "+Upd.RequireUserUpdateMessage.ToString);
End Sub updateprepare;
After executing the example in the console window the message, containing the information about the security subjects for which the access permissions will be updated, will be displayed.
To execute an example, add links to the Metabase and Stat system assemblies. The C:\Update.pefx update file is required.
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
Upd: IMetabaseUpdate;
i: Integer;
Begin
MB := Params.Metabase;
Upd := Mb.CreateUpdate();
Upd.LoadFromFileNF("D:\"+ "Update.pefx",UpdateLoadMode.ulmReplace);
Upd.Prepare();
updateprepare(Upd);
Upd.SaveAvailable("D:\"+ "Update.pefx");
End Sub Main;
Shared Sub updateprepare (update: IMetabaseUpdate);
Var
mbuss: IMetabaseUpdateAccessSubjects;
mbus: IMetabaseUpdateAccessSubject;
Upd: IMetabaseUpdate;
Begin
Upd := update;
mbuss := Upd.Subjects;
For i:=0 To mbuss.Count - 1 Do
mbus := mbuss.Item(i);
System.Diagnostics.Debug.WriteLine("Appropriate sid of the user: "+mbus.RemappingSid.AsString);
System.Diagnostics.Debug.WriteLine("Alternative sid of the user (search by name, if the subject is not found by sid): "+mbus.AlternativeSid.AsString);
If mbus.AlternativeSid.AsString = "" Then
If mbus.RemappingSid.AsString <> "" Then
System.Diagnostics.Debug.WriteLine(mbuss.FindBySidString(mbus.RemappingSid.AsString).Name);
Else System.Diagnostics.Debug.WriteLine("New user: "+mbus.Name +" Sid: "+mbus.Sid.AsString);
End If;
End If;
End For;
debug.WriteLine("Updating users is required: "+Upd.RequireUserUpdateMessage.ToString);
End Sub updateprepare;
After executing the example in the console window the message, containing the information about the security subjects for which the access permissions will be updated, will be displayed.
See also: