plugin_role.c 773 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. /*
  13. * plugin_role.c - routines for calling roles plugins
  14. */
  15. #include "slap.h"
  16. static roles_check_fn_type roles_check_exported = NULL;
  17. int slapi_role_check(Slapi_Entry *entry_to_check, Slapi_DN *role_dn, int *present)
  18. {
  19. int rc = 0;
  20. if ( roles_check_exported != NULL )
  21. {
  22. rc = (roles_check_exported)(entry_to_check, role_dn, present);
  23. }
  24. return rc;
  25. }
  26. void slapi_register_role_check(roles_check_fn_type check_fn)
  27. {
  28. roles_check_exported = check_fn;
  29. }