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> diruseradd()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DirUserAdd()
------------------------------------------------------------------------------
 Purpose:
 Add a user to a directory trustee list.

 Syntax:
 bResult = DirUserAdd( dwUserID, lpszPath, iRights )

 Parameters:
 dwUserID The ID number of the user.
 lpszPath The full NetWare path and directory name.
 iRights  The maximum access rights.

 Returns:
 A boolean value (TRUE or FALSE).

 Description:
 DirUserAdd() returns TRUE if the user specified by ID number dwUserID was
 successfully added to the trustee list of the specified network directory.
 lpszPath must be the full NetWare path of the directory, including the
 volume name.

 Returns FALSE if an error occurs and the user was not added. The maximum
 access rights granted to the user is specified by iRights, which is
 obtained by adding the required 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). DirUserAdd() allows trustee assignments to be set on files under
 NetWare 386.
 Returns FALSE if an error occurs.

 Example:
 // To add the user STEVE to the trustees of the network
 // directory SYS:ACC\WORK and grant him Read, Open and Search rights on a
 // NetWare 286 server:

 if ( DirUserAdd( UsrIDGet( "STEVE"), "SYS:ACC\WORK", 69 ) )
    ? "User STEVE now has access to SYS:ACC\WORK"
 endif

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

 if ( DirUserAdd( UsrIDGet( "MIKE" ), "SYS:PUBLIC\MSDOS", 67 ) )
    ? "User MIKE is now a trustee of SYS:DATA"
 endif

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

 if ( DirUserAdd( UsrIDGet( "DAVE" ), "SYS:DATA\KATIE.TXT", 511 ) )
    ? "User DAVE is now a trustee of file SYS:DATA\KATIE.TXT"
 endif

 Notes:
 Appropriate trustee access rights are required.

 To use this function in a CA-Clipper Summer `87 program it is necessary to
 compile and link in NOVLIB87.PRG.

See Also: DirUsrDel() DirEffRtGet()

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