GetAllowed(DesiredAccess: Integer; Attribute: IMetaAttribute; Selection: IDimSelection);
DesiredAccess. Value that determines operations with segment elements, performance possibility of which must be checked.
Attribute. Attribute that determines dimension.
Selection. Dimension elements selection.
The GetAllowed property is used to get a selection of dimension elements, which are available for executing of specified actions by the current user.
Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier that contains determined segments, and a factor attribute with the COUNTRY identifier that refers to a dictionary.
Sub Main;
Var
mb: IMetabase;
rubInst: IRubricatorInstance;
Rub: IRubricator;
Segs: IRubricatorSegments;
Attr: IMetaAttribute;
Dict: IMetabaseObject;
DI: IDimInstance;
Sel: IDimSelection;
Begin
mb := MetabaseClass.Active;
Rub := mb.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;
rubInst := (Rub As IMetabaseObjectDescriptor).Open(Null) As IRubricatorInstance;
Segs := rubInst.Segments;
Attr := Rub.Facts.Attributes.FindById("COUNTRY");
Dict := Attr.ValuesObject.Bind;
DI := Dict.Open(Null) As IDimInstance;
Sel := DI.CreateSelection;
Sel.SelectAll;
Segs.GetAllowed(MetabaseObjectPredefinedRights.Read, Attr, Sel);
Debug.WriteLine(Sel.ToString);
End Sub Main;
After executing the example selection of elements, available for reading by the current user, is displayed in the console window.
See also: