ISecurityDescriptor.HasAccessAudit

Syntax

HasAccessAudit(Subject: ISecuritySubject; DesiredAccess: Integer; Var Access: Boolean; Var Audit: Boolean);

Parameters

Subject. Security subject, which is checked for presence of permissions for particular operations on the object.

DesiredAccess. Mask that determines operations, permissions for which must be checked for the Subject security subject. 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:

Access. Variable, which determines whether there are permissions to perform specified operations on the object. The variable is set to True if the security subject has permissions to perform all specified operations on the object.

Audit. The variable that determines whether specified operations for the Subject security subject are audited. The variable is set to true if the specified security subject is audited at least by one of the specified operations.

Description

The HasAccessAudit method checks and returns whether user has the rights to perform the specified operations and whether specified operations on object are audited.

Example

Executing the example requires that the repository contains an object with the Obj_1 identifier. There is the TestUser user among the security subjects that were created in the security manager of the current repository.

Sub UserProc;
Var
    MB: IMetabase;
    MDesc: IMetabaseObjectDescriptor;
    SecDesc: ISecurityDescriptor;
    Subj: ISecuritySubject;
    b, b1: Boolean;
Begin
    MB := MetabaseClass.Active;
    Subj := MB.Security.ResolveName("TestUser");
    MDesc := MB.ItemById("Obj_1");
    SecDesc := MDesc.SecurityDescriptor;
    SecDesc.HasAccessAudit(Subj,
        MetabaseObjectPredefinedRights.Access +
        MetabaseObjectPredefinedRights.Delete, b, b1);
End Sub UserProc;

After executing this example the "b" variables determine whether user has the rights to change the rights and remove the object and the "b1" variable indicates whether one of this operations is audited. The check is made for the Obj_1 repository object relative to the TestUser user.

See also:

ISecurityDescriptor