BitCount: Integer;
The BitCount property returns number of security subjects which may have permissions defined.
Executing the example requires that the scheme contains an MDM repository with the MDM identifier and an MDM dictionary with the Dict_1 identifier.
Sub UserProc;
Var
MB : IMetabase;
Object : IMetabaseObjectDescriptor;
AOS : IAccessObjectSecurity;
Iterator : IAccessElementsIterator;
element : IAccessElement;
AttributeValue : IAccessAttributeValue;
i : Integer;
Begin
MB := MetabaseClass.Active;
Object := MB.ItemByIdNamespace("Dict_1", MB.ItemById("RDS").Key);
AOS := Object.GetSecurity;
Iterator := AOS.GetElements;
Iterator.Next;
element := Iterator.Current;
AttributeValue := element.AttributeAccess(AccessElementAttributes.Read);
Debug.WriteLine("number of security subjects " + AttributeValue.BitCount.ToString);
For i:=0 To AttributeValue.BitCount Do
Debug.WriteLine(AttributeValue.Value(i));
End For;
End Sub Button4OnClick;
After executing this example the number of possible access subjects and also a right value on reading the first element of MDM dictionary for each subject are displayed into console window.
See also: