HasAccess(AccessMask: Integer): Boolean;
AccessMask.Mask that determines operations, the availability of rights to which it is necessary to check for the current user. It is necessary to use values of the enumeration type MetabaseObjectPredefinedRights to form mask value. This enumeration contains basic and additional operations on which permissions can be given and access audit can be led. The specific operations are available for defined classes of objects. To use specific operations depending on the object class in a mask there is a possibility to use values of the following enumerations:
CalculatedCubeSpecificRights are specific operations available for calculated cubes.
CubeLoaderSpecificRights are specific operations available for loading data in a cube.
CubeSpecificRights are specific operations available for different types of cubes.
CustomObjectSpecificRights are specific operations available for objects of custom classes.
DataBaseSpecificRights are specific operations available for repository object - Database.
DictionarySpecificRights are specific operations available for repository objects - MDM Dictionary and Composite MDM dictionary.
MDCalcSpecificRights are specific operations available for repository object - Multidimensional calculation on DB server.
ScenarioDimensionSpecificRights are specific operations available for the repository object - Modeling Scenario.
ProblemSpecificRights are specific operations available for an object of modeling container - Modeling task.
ProcedureSpecificRights are specific operations available for repository object - Procedure.
TableSpecificRights are specific operations available for the following repository objects - Table, View, Log, External table.
ValidationSpecificRights are specific operations available for repository object - Validation rule and Validation group.
The HasAccess method checks whether the current user has permissions to execute specified operations with object.
Operations, the availability of rights to which should be checked, are passed by the AccessMask parameter. If the current user has rights to all specified operations, the method returns True, if not, the method returns False.
Executing the example requires that the repository contains an object with the Obj&1 identifier.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObjectDescriptor;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("Obj_1");
Debug.WriteLine(MObj.HasAccess(
MetabaseObjectPredefinedRights.ExportData Or
MetabaseObjectPredefinedRights.ImportData));
End Sub UserProc;
After executing this example an indicator of availability of rights of the current user to export and import the data of the object with the Obj_1 identifier is displayed in the development environment console.
See also: