Function : Database

NSFDbCopyTemplateACL - Copy database template's ACL to a new database.
----------------------------------------------------------------------------------------------------------

#include <nsfdb.h>

STATUS LNPUBLIC NSFDbCopyTemplateACL(
DBHANDLE hSrcDB,
DBHANDLE hDstDB,
char far *Manager,
WORD DefaultAccessLevel);

Description :

This function copies a database template's Access Control List (ACL) to a newly created database. This function copies only the ACL entries of the form [User Name] and converts them to the form User Name during the copy. It also allows you to add one username to the new database's ACL with manager access.

Parameters :

Sample Usage :


  /* if New DB from a template */

  if (argc == 4 && (copy_type == 'N'
      || copy_type == 'G' || copy_type == 'H'))
  {
      /* If from template, use replicainfo defaults */

      replica_info_dst.Flags |= REPLFLG_IGNORE_DELETES;
      replica_info_dst.CutoffInterval = 90;
      OSCurrentTIMEDATE(&replica_info_dst.Cutoff);
      if (TimeDateAdjust(&replica_info_dst.Cutoff, 0, 0, 0,
                   -((int) replica_info_dst.CutoffInterval), 0, 0))
          goto Exit;

      if (error_status = NSFDbCopy(db_handle_src, db_handle_dst,
                             copy_cutoff_td, NOTE_CLASS_ALLNONDATA))
          goto Exit;
      if (error_status = NSFDbCopyTemplateACL(db_handle_src,
                             db_handle_dst, user_name,
                             ACL_LEVEL_MANAGER))
          goto Exit;
   }


See Also :

ACL_LEVEL_xxx
----------------------------------------------------------------------------------------------------------