GetSubjectAllowed(Subject: ISecuritySubject; DesiredAccess: Integer; Attribute: IMetaAttribute; Selection: IDimSelection);
Subject. Security subject.
DesiredAccess. The value that determines operations with segment elements, performance possibility of which must be checked. To specify mask value, use values of the MetabaseObjectPredefinedRights enumeration type in combination with CubeSpecificRights. The Read and Write operations are used when permissions to segments are granted.
Attribute. The attribute that determines dimension.
Selection. Dimension elements selection.
The GetSubjectAllowed property is used to get a selection of dimension elements, which are available for executing the specified actions by the specified 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;
mbSec: IMetabaseSecurity;
User: IMetabaseUser;
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;
mbSec := MB.Security;
User := mbSec.ResolveName("ADMIN") As IMetabaseUser;
Segs.GetSubjectAllowed(User, MetabaseObjectPredefinedRights.Read, Attr, Sel);
Debug.WriteLine(Sel.ToString);
End Sub Main;
After executing the example the console window displays selection of elements available for reading by the ADMIN user.
See also: