HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
#include "slapi-plugin.h"
int slapi_access_allowed( Slapi_PBlock *pb, Slapi_Entry *e, char *attr,
struct berval *val, int access );
Parameters This function takes the following parameters:
Parameter block passed into this function.
pb
Entry for which you want to check the access rights.
e
Attribute for which you want to check the access rights.
attr
Pointer to the berval structure containing the value for which you want to
check the access rights.
val
Type of access rights for which you want to check; for example, to check for
write access, pass SLAPI_ACL_WRITE as the value of this argument.
access
The value of the access argument can be one of the following:
Permission to add a specified entry.
SLAPI_ACL_ADD
Permission to compare the specified values of an attribute in an entry.
SLAPI_ACL_COMPARE
Permission to delete a specified entry.
SLAPI_ACL_DELETE
Permission to read a specified attribute.
SLAPI_ACL_READ
Permission to search on a specified attribute or value.
SLAPI_ACL_SEARCH
Permission to write a specified attribute or value or permission to rename a
specified entry.
SLAPI_ACL_WRITE
Returns This function returns one of the following values:
LDAP_SUCCESS if the user has the specified rights to the entry, attribute, or value.
LDAP_INSUFFICIENT_ACCESS if the user does not have the specified rights to the entry,
attribute, or value.
If a problem occurs during processing, the function will return one of the following error codes:
An error occurred while executing the operation. This error can occur if, for
example, the type of access rights you've specified are not recognized by the
server (in other words, you did not pass a value from the previous table).
LDAP_OPERATIONS_ERROR
Invalid syntax was specified. This error can occur if the ACL associated with
an entry, attribute, or value uses the wrong syntax.
LDAP_INVALID_SYNTAX
The 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.
LDAP_UNWILLING_TO_PERFORM
16.2 slapi_acl_check_mods()
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.
Suppose 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.
156 Functions for access control