IPrivilege.HolderCount

Syntax

HolderCount: Integer;

Description

The HolderCount property returns the number of security subjects (the users or groups of users) that have this privilege.

Example

Sub Main;

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("Entry");

Debug.WriteLine("The following security subjects have the privilege of logging in the platform:");

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 Main;

After executing the example the development environment console will display the list of security subjects having the privilege of logging in the platform.

See also:

IPrivilege