]> git.sur5r.net Git - openldap/commitdiff
ITS#6468: Implement bi_access_allowed.
authorRein Tollevik <rein@openldap.org>
Tue, 2 Feb 2010 15:51:32 +0000 (15:51 +0000)
committerRein Tollevik <rein@openldap.org>
Tue, 2 Feb 2010 15:51:32 +0000 (15:51 +0000)
servers/slapd/backglue.c

index ee0c556281b01f46138106a6d192726a182118ac..94ce55066259e486b58087caedc59678eb4fd735 100644 (file)
@@ -1289,6 +1289,29 @@ glue_sub_add( BackendDB *be, int advert, int online )
        return rc;
 }
 
+static int
+glue_access_allowed(
+       Operation               *op,
+       Entry                   *e,
+       AttributeDescription    *desc,
+       struct berval           *val,
+       slap_access_t           access,
+       AccessControlState      *state,
+       slap_mask_t             *maskp )
+{
+       BackendDB *b0, *be = glue_back_select( op->o_bd, &e->e_nname );
+       int rc;
+
+       if ( be == NULL || be == op->o_bd || be->bd_info->bi_access_allowed == NULL )
+               return SLAP_CB_CONTINUE;
+
+       b0 = op->o_bd;
+       op->o_bd = be;
+       rc = be->bd_info->bi_access_allowed ( op, e, desc, val, access, state, maskp );
+       op->o_bd = b0;
+       return rc;
+}
+
 int
 glue_sub_init()
 {
@@ -1309,6 +1332,7 @@ glue_sub_init()
        glue.on_bi.bi_chk_controls = glue_chk_controls;
        glue.on_bi.bi_entry_get_rw = glue_entry_get_rw;
        glue.on_bi.bi_entry_release_rw = glue_entry_release_rw;
+       glue.on_bi.bi_access_allowed = glue_access_allowed;
 
        glue.on_response = glue_response;