Holder(Index: Integer): ISecuritySubject;
Index. Security subject index.
The Holder property returns parameters of the security subject (user or group of users) that has this privilege.
If the security subject is the user with the lazy loading of description, the property returns only the basic description (Name, security subject type and security descriptor). To get all parameters of the user, use the IMetabaseSecurity.ResolveName, IMetabaseSecurity.ResolveSid methods or search via IMetabaseSecurity.NewSubjectsSearch.
To execute the example, add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
MP: IMetabasePolicy;
Priv: IPrivilege;
Subject: ISecuritySubject;
i: Integer;
Begin
MB := MetabaseClass.Active;
MS := MB.Security;
MP := MS.Policy;
Priv := MP.Privilege("LOGIN");
Debug.WriteLine("The following security subjects have platform login privilege:");
For i := 0 To Priv.HolderCount - 1 Do
Subject := Priv.Holder(i);
If Subject.Type = SecuritySubjectType.Group Then
Debug.WriteLine("Group: " + Subject.Name);
Else
Debug.WriteLine("User: " + Subject.Name);
End If;
End For;
End Sub UserProc;
After executing the example the development environment console displays the list of security subjects having the platform login privilege.
See also: