RemoveSubject(Subj: ISecuritySubject): Boolean;
RemoveSubject(Prognoz.Platform.Interop.Metabase.ISecuritySubject): System.Boolean;
Subj. Security subject to be removed.
The RemoveSubject method removes the security subject, passed by the Subj parameter.
To execute the example, add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
SS: ISecuritySubject;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
// Delete group of users
SS := MS.Groups.Item(MS.Groups.Count - 1);
MS.RemoveSubject(SS);
// Save changes
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
SS: ISecuritySubject;
Lic: Object;
Begin
MB := Params.Metabase;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
// Delete group of users
SS := MS.Groups.Item[MS.Groups.Count - 1];
MS.RemoveSubject(SS);
// Save changes
MS.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example the last users group, created in security manager of the current repository, is removed.
See also: