Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Advantage CA-Clipper Guide v6.11 - ax_rightscheck() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 AX_RightsCheck()
 Sets security method used to open or create files
------------------------------------------------------------------------------

 Syntax

     AX_RightsCheck( [.T.|.F.] ) -> logical

     [.T.|.F.] A logical value used to set the Advantage security methods.

 Returns

     If no parameter is passed to AX_RightsCheck(), then returns the
     current Advantage security method (i.e. .T. for security
     based on network OS file/directory rights or .F. for security
     based on Advantage application access).  If a parameter is
     passed to AX_RightsCheck(), then returns previous security
     setting.

 Description

     AX_RightsCheck( .T. ) causes any newly opened work areas to use
     the network OS file/directory rights form of security. That is,
     it verifies that the user has the necessary rights before
     allowing the user to create or open the specified file. This is
     the default.

     AX_RightsCheck( .F. ) causes any newly opened work areas to access
     files through the Advantage server without checking file/directory
     access rights. This allows the network administrator to "hide" Xbase
     data files from users who are not accessing data through an
     Advantage application. The Xbase data is secure by removing all
     the appropriate rights to the directories in which the data
     files are located. Only Advantage applications using this
     security method may access the data files. The Advantage server
     will create, open, and/or update these "hidden" files with its
     server "administrator" privileges.

     Note:  A change in the AX_RightsCheck() setting only affects those
     work areas opened or created after the AX_RightsCheck() setting is
     changed. Therefore, the method of security can be on a per-
     work area basis.

     Note: CA-Clipper functions such as FILE(), FOPEN(), and
     FERASE() are not RDD functions. Thus, they will not be able to take
     advantage of the Advantage Database Server's "administrator" privileges.
     So, if the system administrator has taken away network rights from a
     directory, non-RDD functions such as FILE(), FOPEN(), and FERASE() may
     not work as expected.

     Note: SET PATH will not be obeyed with the "rights checking off"
     form of Advantage security.  If no path is specified with a file name
     to be created or opened, and a SET PATH path(s) has been specified, the
     path(s) specified in the SET PATH command will NOT be searched when
     the file is attempted to be opened with "rights checking off".  The
     SET PATH path(s) will be searched when a file is attempted to be
     opened/created with "rights checking on" but will NOT be searched
     with "rights checking off".

     Note: If rights checking is set to .F., you may need to specify the
     directory where the semaphore connection file will be located. See your
     Advantage server guide for more information.

 Example

     // Assume user does not have network READ and WRITE rights to the
     //  x:\NORIGHTS directory but has sufficient network rights to the
     //  x:\HASRIGHT directory.

     AX_RightsCheck( .T. )      // Obey network rights

     USE x:\hasright\file1.dbf VIA "DBFNTX"     // Will succeed
     USE x:\hasright\file2.dbf VIA "DBFNTXAX"   // Will succeed
     USE x:\norights\file3.dbf VIA "DBFNTX"     // Will fail
     USE x:\norights\file4.dbf VIA "DBFNTXAX"   // Will fail
     CLOSE ALL

     // Ignore network rights. Effectively hides files from non-Advantage
     // work areas
     AX_RightsCheck( .F. )

     USE x:\hasright\file1.dbf VIA "DBFNTX"     // Will succeed
     USE x:\hasright\file2.dbf VIA "DBFNTXAX"   // Will succeed
     USE x:\norights\file3.dbf VIA "DBFNTX"     // Will fail
     USE x:\norights\file4.dbf VIA "DBFNTXAX"   // WILL SUCCEED!
     CLOSE ALL


See Also: SET RIGHTS CHECKING

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