CheckAndAudit(Operation: Integer; Comment: String): Decimal;
CheckAndAudit(Operation: integer; Comment: string): decimal;
Operation. Mask that determines operations, the availability of rights to which it is necessary to check for the current user. To create a mask value, it is necessary to use the MetabaseObjectPredefinedRights enumeration type values. 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.
ProblemSpecificRights are specific operations available for an object of modeling container - Modeling task.
ProcedureSpecificRights are specific operations available for repository object - Procedure.
ScenarioDimensionSpecificRights are specific operations available for the repository object - Modeling Scenario.
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.
Comment. The comment that is entered in the access protocol.
The CheckAndAudit method checks the access permissions of the current user for the specified operations and writes the record into the access protocol with the specified comment.
If the current user does not have rights even to one of checked operations, the record with failed result will be entered in the access protocol and the exceptional condition will be generated.
The method returns unique key of the record which is written in the access protocol.
If it is necessary to check access permissions for custom class operation, use the IMetabaseCustomObject.CheckAndAudit method.
Executing the example requires that the repository contains an object with the Obj_1111 identifier.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObjectDescriptor;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("Obj_1111");
MObj.CheckAndAudit(
MetabaseObjectPredefinedRights.Delete Or
MetabaseObjectPredefinedRights.Access,
"Check whether the current user has permissions for the Removal and Change Permissions operations" );
End Sub UserProc;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MObj: IMetabaseObjectDescriptor;
Begin
MB := Params.Metabase;
MObj := MB.ItemById["Obj_1111"];
MObj.CheckAndAudit(
MetabaseObjectPredefinedRights.moprDelete As Integer Or
MetabaseObjectPredefinedRights.moprAccess As Integer,
"Check whether the current user has permissions for the Removal and Change Permissions operations" );
End Sub;
After executing this example the availability of the rights of the current user to remove and change access permissions of the Obj_1111 object is checked. The appropriate record is added to the access protocol.
See also: