Sun Directory Server Enterprise Edition 7.0 Developer's Guide

slapi_acl_check_mods()

Determines if a user has the rights to perform the specified modifications on an entry.

Syntax

#include "slapi-plugin.h"
int slapi_acl_check_mods( Slapi_PBlock *pb, Slapi_Entry *e,
     LDAPMod **mods, char **errbuf );

Parameters

This function takes the following parameters:

pb

Parameter block passed into this function.

e

Entry for which you want to check the access rights.

mods

Array of LDAPMod structures that represent the modifications to be made to the entry.

errbuf

Pointer to a string containing an error message if an error occurs during the processing of this function.

Returns

Returns one of the following values:

LDAP_OPERATIONS_ERROR

An error occurred while executing the operation.

LDAP_INVALID_SYNTAX

Invalid syntax was specified.

This error can occur if the ACL associated with an entry, attribute, or value uses the wrong syntax.

LDAP_UNWILLING_TO_PERFORM

The DSA (this directory server) is unable to perform the specified operation.

This error can occur if, for example, you are requesting write access to a read-only database.

Description

Call this function to determine if a user has access rights to modify the specified entry. The function performs this check for users who request the operation that invokes this plug-in.

For example, if you are writing a database plug-in, you can call this function to determine if users have the proper access rights before they can add, modify, or delete entries from the database.

As part of the process of determining if the user has access rights, the function does the following:

Memory Concerns

You must free the errbuf buffer by calling slapi_ch_free() when you are finished using the error message.

See Also

slapi_access_allowed()

slapi_ch_free()