IRubricatorSegmentsSet.GetSubjectEffectiveRights

Syntax

GetSubjectEffectiveRights(Subject: ISecuritySubject): Integer;

Parameters

Subject. Security subject, which effective permissions must be obtained.

Description

The GetSubjectEffectiveRights property returns effective permissions of the specified user for the collection of data segments.

Comments

Effective permissions include all the operations, which are explicitly allowed for the user. The value that is returned by this method is represented by an access mask. Mask value is an 8-bit byte binary number reduced to decimal form. To check mask value, use values of the  MetabaseObjectPredefinedRights  enumerable type in combination with  CubeSpecificRights. To parse mask value, implement the custom function that enables the user to map separate mask bits to appropriate enumeration values. The example of work with access mask is provided in the Examples: Work with Access Mask section. The Read and Write operations are used when permissions to segments are granted.

Example

Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier, in which segments must be determined.

Sub UserProc;
Var
    Mb: IMetabase;
    RubInst: IRubricatorInstance;
    Segs: IRubricatorSegments;
    MbSec: IMetabaseSecurity;
    User: IMetabaseUser;
Begin
    Mb := MetabaseClass.Active;
    RubInst := Mb.ItemById("OBJ_RUBRICATOR").Open(NullAs IRubricatorInstance;
    Segs := RubInst.Segments;
    MbSec := MB.Security;
    User := MbSec.ResolveName("ADMIN"As IMetabaseUser;
    Debug.WriteLine(Segs.GetSubjectEffectiveRights(User));
End Sub UserProc;

After executing the example the console displays effective permissions of the ADMIN user for the data segment collection in decimal format.

See also:

IRubricatorSegmentsSet