IMetabaseObjectDescriptor.HasAccess

Syntax

HasAccess(AccessMask: Integer): Boolean;

Parameters

AccessMask.Mask that determines operations, the availability of rights to which it is necessary to check for the current user. To create a mask value, one should use values of the MetabaseObjectPredefinedRights enumeration type. This enumeration contains basic and additional operations on which permissions can be granted and access audit can be led. The specific operations are available for specific object classes. To use specific operations depending on the object class, one can use values of the following enumerations in a mask:

Description

The HasAccess method checks whether the current user has permissions to execute the specified operations with object.

Comments

Operations the availability of permissions to which should be checked are sent by the AccessMask parameter. If the current user has rights to all the specified operations, the method returns True, otherwise the method returns False.

Example

Executing the example requires that the repository contains an object with the ObjTest identifier.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById(
"ObjTest");
    Debug.WriteLine(MObj.HasAccess(
    MetabaseObjectPredefinedRights.ExportData 
Or
    MetabaseObjectPredefinedRights.ImportData));
End Sub UserProc;

After executing the example the development environment console displays an indicator of availability of permissions of the current user to export and import the data of the object with the ObjTest identifier.

See also:

IMetabaseObjectDescriptor