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> direffectiverightsget()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DirEffectiveRightsGet()
------------------------------------------------------------------------------
 Purpose:
 Get a user's effective rights in a directory.

 Syntax:
 iRights = DirEffectiveRightsGet( lpszPath )

 Parameters:
 lpszPath The full NetWare path name of the directory.

 Returns:
 A numeric value (signed short int).

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

 Description:
 DirEffectiveRightsGet() returns a numeric value indicating the effective
 rights of the requesting workstation in the network directory specified
 by lpszPath. lpszPath must be the full NetWare path of the directory,
 including the volume name.

 The effective rights value is obtained 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
 The return values are almost identical, except that under NetWare 3 and 4,
 there is no Open return value. This is because File Scan is an amalgamation
 of the old Search and Open attributes. There is also a new attribute called
 Supervisory. For example the return value 507 is actually 1 + 2 + 8 + 16
 +32 + 64 + 128 + 256 = 507, and is a valid return value for NetWare 386.

 DirEffectiveRightsGet() returns the EFFECTIVE RIGHTS the user has to a
 directory. This is calculated by:
 Effective rights = User's Trustee rights & Maximum rights mask
 where "&" is the logical AND. A user may have ALL rights to a particular
 directory in his trustees assignments, but if the directory's maximum
 rights mask only allows, for example, Read and File Scan, then the
 effective rights would be:
 User's         Directory      Effective
 rights         IR mask        Rights

 R        &  R        =  R
 W        &  -        =  -
 -        &  -        =  -
 C        &  -        =  -
 E        &  -        =  -
 A        &  -        =  -
 F        &  F        =  F
 M        &  -        =  -
 S        &  -        =  -

 A directory's maximum rights mask can be found using the NOVLIB function
 DirIRMaskGet().
 Returns NOVERRINT if an error occurs.

 Example:
 // To display the effective rights in the SYS:SYSTEM directory:
 iEffRights = DirEffectiveRightsGet( "SYS:SYSTEM" )
 if ( iEffRights != NOVERRINT )
    ? "The effective rights of SYS:SYSTEM are", iEffRights
 endif

 Notes:
 For more information on rights masks, see Directory Services:
 Rights and Attributes in the Appendix.

See Also: DirUserAdd() DirUserDelete() DirIRMaskGet() / DirIRMaskSet()

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