[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FN_INGROUP()
 Determine if user is in a user group
------------------------------------------------------------------------------
 Syntax
 
      fn_inGroup( <cGroup> [,<cUser> | <nConn> ] ) -> lInGroup
 
 Arguments

    <cGroup> is the name of the user group that you will test for
    the user's membership status.

    The second parameter can be either a character or a numeric,
    and is optional.  You can place one of two values in the second
    parameter:

       <cUser> is the user name to test
       <nConn> is the logical connection number to test

    If the second parameter is omitted, then the name of the current
    user is assumed.

 Returns

    .t. if the user is in the selected group, .f. if the user is not.

 Description

    fn_inGroup() provides a simple "wrapper" around the fn_bndoins()
    function ("Is Bindery Object in Set").  This allows you to test
    whether or not a user belongs to  a selected user group, as
    defined in the NetWare operating system's bindery.

    This can be useful for partitioned security.  For example, you
    can restrict certain parts of an application to users in
    certain user groups.  See the examples below.

 Examples

    *  Test current user's group membership for security reasons:

         if fn_inGroup( "PAYROLL" )
            doPayroll()
         else
            qout( "Not authorized" )
         endif

    *  Test a specific user's membership in the "EVERYONE" group:

         qout( fn_inGroup( "EVERYONE", "SUPERVISOR" ) )


    *  Test to see if the user on connection 5 is in "PROGRAMMERS":

         qout( fn_inGroup( "PROGRAMMERS", 5 ) )


 Source: N:\SRC\BINDERY\INGROUP.PRG

 Author: Glenn Scott

See Also: fn_bndoins()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson