GetSubjectEffectiveRights(Subject: ISecuritySubject): Integer;
Subject. Security subject, which effective permissions must be obtained.
The GetSubjectEffectiveRights method returns effective permissions of the specified user for the factor.
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, it is required to use values of the MetabaseObjectPredefinedRights enumerable type in combination with CubeSpecificRights. To parse mask value, implement the custom function that enables the user to compare separate mask bits to appropriate enumeration values. Examples of work with access mask are given in theWorking with Access Mask section. When permissions for the factor are distributed, the Read and Write operations are used.
Executing the example requires that repository contains time series database with the OBJ_RUBRICATOR identifier where segments are identified and the fact metadictionary table contains 3 in the Facts column.
To execute the example, add links to the Cubes and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
RubInst: IRubricatorInstance;
Rub: IRubricator;
Fac: IRubricatorFactor;
MS: IMetabaseSecurity;
User: IMetabaseUser;
Begin
MB := MetabaseClass.Active;
Rub := MB.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;
RubInst := (Rub As IMetabaseObjectDescriptor).Open(Null) As IRubricatorInstance;
Fac := rubInst.GetFactData(3).Factor;
MS := MB.Security;
User := MS.ResolveName("ADMIN") As IMetabaseUser;
Debug.WriteLine(Fac.GetSubjectEffectiveRights(User));
End Sub UserProc;
After executing the example the console displays effective permissions of the ADMIN user to the fact indicator with the 3 key. The permissions are represented in decimal form.
See also: