GetEffectiveRights

Returns the current connection’s effective rights to a directory or file

Local Servers:blocking
Remote Servers:blocking
Classification:3.x, 4.x, 5.x, 6.x
SMP Aware:No
Service:File System

Syntax

   #include <nwdir.h> 
    
    int GetEffectiveRights (  
       char   *pathName, 
       WORD   *effectiveRightsMask);
   

Parameters

pathName

(IN) Specifies the string containing the path specification (maximum 255 characters, including the NULL terminator).

effectiveRightsMask

(OUT) Returns the current connection’s rights to the specified directory or file.

Return Values

Value

Hex

Constant

0

(0x00)

ESUCCESS

152

(0x98)

ERR_VOLUME_DOES_NOT_EXIST

191

(0xBF)

ERR_INVALID_NAMESPACE

Remarks

This function specifies the directory or file by passing a pathname. The pathName parameter can identify an absolute or relative directory or file path. An absolute path includes a volume. Examples of absolute pathnames would be:

volume:directory\...\directory\filename

volume:filename

 

volume:

(equivalent to volume:\)

Applications can use a relative file path to specify a directory or file. The relative path, combined with the CWD specifies an absolute file path. For example, if the CWD points to SYS:\ and the specified pathname is PUBLIC\WORDP or PUBLIC\WORDP\ABC.TXT, then in the former case, the resulting directory is SYS:PUBLIC\WORDP and in the latter case, SYS:PUBLIC\WORDP\ABC.TXT.

The effectiveRightsMask parameter returns a user’s effective rights to the specified directory or file.

Given the following path, where component1 through componentn-1 are directories, and componentn is either a file or directory:

      volume:component1\component2\...\componentn
   

A user’s effective rights to a file or in a directory can be determined using the following algorithm.

  • Initialize the user’s effective rights to whatever rights are granted to the current connection in the root of the specified volume.

  • For each component (component1 through componentn), the effective rights are intersected (ANDed) with the component’s inherited rights mask.

  • If the current connection is granted any rights (is a trustee) in the component, then the effective rights are ORed (|) together with the rights granted to the current connection in the component.

For NetWare 3.x and 4.x, the bits in an effective rights mask are defined as follows:

For versions of NetWare previous to 3.0, the trustee rights appear in a 1-byte format as follows:

SetCurrentNameSpace sets the name space which is used for parsing the path input to this function.

NOTE:For NetWare versions before 4.x, this function only works with DOS name space for remote servers.

See Also

AddTrustee, DeleteTrustee, ModifyInheritedRightsMask