Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Novlib 3.30 Online Reference - <b> dirobjectadd()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DirObjectAdd()
------------------------------------------------------------------------------
 Purpose:
 Add an object to a directory trustee list.

 Syntax:
 bResult = DirObjectAdd( dwObjID, lpszPath, iRights )

 Parameters:
 dwObjID  The bindery ID number of the object.
 lpszPath The full NetWare path of the directory.
 iRights  The rights mask.

 Returns:
 A boolean value (TRUE or FALSE).

 The CA-Clipper name for this function is:
 DirObjAdd()

 Description:
 DirObjectAdd() adds a bindery object specified by its bindery ID number
 dwObjID, to the directory trustee list of a directory specified by
 lpszPath. iRights is the rights that the object will have in the
 directory. lpszPath must be the full NetWare path of the directory,
 including the volume name. For example, SYS:PUBLIC\MSDOS.

 The rights mask iRights is calculated by adding values from the following
 table:

 Value NetWare 286 NetWare 386 & NetWare 4.0

 1     Read        Read
 2     Write       Write
 4     Open        Reserved
 8     Create      Create
 16    Delete      Erase
 32    Parental    Access Control
 64    Search      File Scan
 128   Modify      Modify
 256   N/A         Supervisor

 Note that the values mean different things under different versions of
 NetWare. For example, if the object is to have Read, Open and Search rights
 in the specified directory under NetWare 2.15, the mask will be 69 (ie. 1 +
 4 + 64). DirObjectAdd() allows trustee assignments to be set on files under
 NetWare 386.

 Returns FALSE if an error occurs.

 Example:
 // To add object JOB_SERVER to the trustee list of SYS:PUBLIC\MSDOS
 // giving it Read, Open and Search rights on a NetWare 286 server
 // (Read and File Scan for NetWare 386):

 if (DirObjectAdd(ObjIDGet("JOB_SERVER", 5 ),"SYS:PUBLIC\MSDOS",69))
    ? "Object JOB_SERVER is now a trustee of SYS:PUBLIC\MSDOS"
 endif

 // To add user group ADMIN to the trustee list of SYS:DATA giving it
 // Read, Write and File Scan rights under NetWare 386:

 if ( DirObjectAdd( ObjIDGet( "ADMIN", 2 ),"SYS:PUBLIC\MSDOS", 67 ) )
    ? "Group ADMIN is now a trustee of SYS:DATA"
 endif

 // To add a user MALC to the trustee list of the file SYS:DATA\KATIE.TOT
 // under NetWare 386, giving it ALL rights:
 // This only works under NetWare 386

 if ( DirObjectAdd( ObjIDGet( "MALC", 1 ),"SYS:DATA\KATIE.TOT",511 ) )
    ? "User MALC is now a trustee of SYS:DATA\KATIE.TOT"
 endif

 Notes:
 The object to be added can be any NetWare object.

 See Chapter 3, Bindery Functions for further information on object types.
 Appropriate trustee access rights are required to use this function.

See Also: DirObjectDelete()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson