ICubeExecuteDataRights.Rights

Syntax

Rights(Coord: IMatrixCoord): CubeDataRights;

Parameters

Coord. Data point coordinate.

Description

The Rights property returns the actual access permission for a data point.

Example

Executing the example requires that the repository contains a time series database with the FC_A identifier.

Sub Main;

Var

Mb: IMetabase;

Cat: IMetabaseObject;

Inst: IRubricatorInstance;

Cub: ICubeInstance;

Dest: ICubeInstanceDestination;

Exe: ICubeInstanceDestinationExecutor;

Sels: IDimSelectionSet;

Sel: IDimSelection;

Arr: Array[1] Of Integer;

Si, Sc: Integer;

Mat: IMatrix;

ExecuteResult: ICubeExecuteResult;

It: IMatrixIterator;

Coo: IMatrixCoord;

Sto: ICubeInstanceStorage;

Rights: ICubeExecuteDataRights;

Begin

Mb := MetabaseClass.Active;

Cat := Mb.ItemById("FC_A").Bind;

Inst := Cat.Open(Null) As IRubricatorInstance;

Cub := Inst As ICubeInstance;

Dest := Cub.Destinations.DefaultDestination;

Sels := Dest.CreateDimSelectionSet;

Sc := Sels.Count - 1;

For Si := 0 To Sc Do

Sel := Sels.Item(Si);

Sel.SelectAll;

End For;

Exe := Dest.CreateExecutor;

(Exe As IRubricatorFactorIO).MultipleFactors := True;

Arr[0] := 125616;

(Exe As IRubricatorFactorExecutor).SetFactorKeys(Arr);

(Sels As ICubeExecuteSetup).RequiredDataRights := CubeDataRights.ReadWrite;

Exe.PrepareExecute(Sels);

Mat := Exe.Matrix;

ExecuteResult := CubeClass.ExecuteResult(Mat);

Rights := ExecuteResult.DataRights;

If Rights <> Null Then

Exe.PerformExecute;

Mat.ValueFlag := 1;

Coo := Mat.CreateCoord;

It := Mat.CreateIterator;

It.Move(IteratorDirection.First);

While It.Valid Do

It.ValueFlag := 0;

If Rights.Rights(Coo) = CubeDataRights.ReadWrite Then

It.ValueFlag := 1;

It.Value := Math.RandBetweenI(0, 5);

End If;

It.Move(IteratorDirection.Next);

End While;

Sto := Dest.CreateStorage;

(Sto As IRubricatorFactorIO).MultipleFactors := True;

Sto.SaveMatrix(Mat, 1);

End If;

End Sub Main;

After executing the example data of time series with the 125616 key, to which the user has read and write permissions, is obtained. Then the data is changed and saved.

See also:

ICubeExecuteDataRights