home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / nettos11.zip / BINDERY / CHGOSEC.PRG < prev    next >
Text File  |  1993-02-23  |  3KB  |  108 lines

  1. /*
  2.  * File......: CHGOSEC.PRG
  3.  * Author....: Kevin Maher/Steve Tyrakowski
  4.  * CIS ID....: 73766,1224
  5.  * Date......: $Date$
  6.  * Revision..: $Revision$
  7.  * Log file..: $Logfile$
  8.  * 
  9.  * This is an original work by Kevin Maher and Steve Tyrakowski
  10.  * and is placed in the public domain.
  11.  *
  12.  * Modification history:
  13.  * ---------------------
  14.  *
  15.  * $Log$
  16.  *
  17.  */
  18.  
  19.  
  20. /*  $DOC$
  21.  *  $FUNCNAME$
  22.  *     FN_cBndOse()
  23.  *  $CATEGORY$
  24.  *     Bindery
  25.  *  $ONELINER$
  26.  *     Change Bindery Object Security
  27.  *  $SYNTAX$
  28.  *
  29.  *     FN_cBndOse(nWrite, nRead, cObject, nType) => lChanged
  30.  *
  31.  *  $ARGUMENTS$
  32.  *
  33.  *     <nWrite> is the Property write security as an integer.
  34.  *      The integer indicates who can add properties
  35.  *      to the bindery object.
  36.  *
  37.  *     <nRead> is the Property read security as an integer.
  38.  *          The integer indicates who can read and scan
  39.  *          properties for a bindery object.
  40.  *
  41.  *         ┌─────────────────────────────────┐
  42.  *         │ Read and Write Security Levels  │
  43.  *         ├──┬──────────────────────────────┤
  44.  *         │ 0│ Anyone                       │
  45.  *         ├──┼──────────────────────────────┤
  46.  *         │ 1│ Logged                       │
  47.  *         ├──┼──────────────────────────────┤
  48.  *         │ 2│ Object                       │
  49.  *         ├──┼──────────────────────────────┤
  50.  *         │ 3│ Supervisor                   │
  51.  *         ├──┼──────────────────────────────┤
  52.  *         │ 4│ Netware Operating System     │
  53.  *         └──┴──────────────────────────────┘
  54.  *
  55.  *     <cObjectName> is the name of the Bindery Object that you are
  56.  *           trying to change the security for.  Max Length = 47
  57.  *
  58.  *     <nObjectType> is the Bindery Object Type.  Manifest constants
  59.  *           describing the defined types are included in the
  60.  *           NETTO.CH header file.  Wildcard characters are
  61.  *           not allowed.
  62.  *
  63.  *  $RETURNS$
  64.  *
  65.  *     <lChanged> logical if security was changed or not.
  66.  *      If an error occurs, .F. will be the return value.
  67.  *
  68.  *  $DESCRIPTION$
  69.  *
  70.  *     This function changes the security of a bindery object.
  71.  *     It requires SUPERVISOR rights.
  72.  *
  73.  *  $SEEALSO$
  74.  *     fn_cProSec()
  75.  *  $EXAMPLES$
  76.  *
  77.  *     // this will make KEVIN's security to SUPERVISOR
  78.  *     lChanged := FN_cBndOse(3,3, "KEVIN", OT_USER)
  79.  *
  80.  *  $END$
  81.  */
  82.  
  83. #include "ftint86.ch"
  84. #include "netto.ch"
  85.  
  86. #define NW_LOG 227
  87.  
  88. #ifdef FT_TEST
  89.   FUNCTION MAIN(nWrite, nRead, cObject, nType)
  90.     IF FN_cBndOse(Val(nWrite), Val(nRead), cObject, Val(nType))
  91.       Qout("Object security was successfully changed.")
  92.     ELSE
  93.       Qout("Object security was not changed.")
  94.     ENDIF
  95.   RETURN ( nil )
  96.  
  97. #endif
  98.  
  99. FUNCTION FN_cBndOse(nWrite, nRead, cObject, nType)
  100.  
  101.   LOCAL cSend := I2BYTE(56);                // 38h API request Code
  102.           + I2BYTE((nWrite * 16) + nRead);  // Security Levels
  103.           + W2HILO(nType);                  // nw_int Object type
  104.           + FN_NameL(cObject,48)            // Object Name
  105.  
  106. RETURN _fnReq(NW_LOG,cSend,"") == ESUCCESS
  107.  
  108.