Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_b_prcreate( <cobject>, <ntype>, <cproperty> [, <nflag> [, <nsecurity> ] ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_B_PRCREATE( <cObject>, <nType>, <cProperty> [, <nFlag> [, <nSecurity> ] ] )


Parameters

<cObject>
Name of an object.

<nType>
Object type.

<cProperty>
Name of the property to add to the object.

<nFlag>
Defines the longevity and type of the property.

<nSecurity>
Defines who will be allowed to read or modify the property.


Returns

Logical true if successful, false otherwise.

If the function returns false, you can call N_ERROR(), which will 
return the NetWare error code.


Description

A new property will be attached to the specified object. If the 
property already exists, or if the object does not exist, no action 
will be taken.

<nType> defines the object type

Value         Object type
 1            User
 2            Group
 3            Print queue
 4            File server
 6            Gateway
 7            Print server
38            Remote bridge


<cProperty> is the name of the property to create.Listed below are some 
common item and set properties.

Item Properties
Name                     Description
ACCOUNT_BALANCE          User's usage balance on
                         server for various
                         services.

IDENTIFICATION           Full name (usually
                         attached to user or 
                         group objects).

NET_ADDRESS              Twelve-byte Internet
                         address (usually attached
                         to server objects).

PASSWORD                 Generally encrypted.

Q_DIRECTORY              Path to a print queue.
                         Must be less than 128
                         characters.

Set Properties
Name                   Owner       Member
GROUPS_I'M_IN          User        Groups an
                                   object 
                                   belongs to.
                                   Usually 
                                   attached to
                                   user or 
                                   group
                                   objects.

GROUP_MEMBERS          Group       Members of a
                                   user group.
                                   Usually 
                                   attached to
                                   group objects.
                                    Note that for
                                   every entry in
                                   a GROUP_MEMBERS
                                   set, there is a
                                   corresponding
                                   entry in a 
                                   GROUPS_I'M_IN
                                   set.

OPERATORS             File server  Console
                                   operators.

Q_OPERATORS           Print queue  User/group who
                                   can reorder or
                                   delete any 
                                   job in the
                                   queue.

Q_SERVERS             Print queue  Print server
                                   that can 
                                   service jobs in
                                   the queue.

Q_USERS               Print queue  User/group who
                                   can place jobs
                                   in the queue.
                                   Usually 
                                   EVERYONE.

SECURITY_EQUALS       User         User/group with
                                   same security
                                   level.

<nFlag> defines the longevity and type of the 
property. Values for each are listed below. 
(Manifest constants are defined in BINDERY.CH.)

Longevity
Value      #define        Property Longevity
0          NB_STATIC      Permanent object.
                          (default)

1          NB_DYNAMIC     Dynamic object that will
                          be removed whenever the 
                          server is rebooted.

Type
Value     #define          Property Type
0         NB_ITEM_PROPERTY Item property
2         NB_SET_PROPERTY  Set property


Determine the value for <nFlag> by adding the longevity and type 
together. For example, NB_SET_PROPERTY + NB_DYNAMIC(2 + 1 = 3) 
indicates a dynamic set property.

<nSecurity> defines who will be allowed to read or modify the property. 
The levels are:

Read Access
Value    #define             Access
0        NB_ANYONE_READ      Anyone attached to
                             the server

1        NB_LOGGED_READ      Anyone logged in to
                             the server

2        NB_OBJECT_READ      Currently logged in
                             user only

3        NB_SUPERVISOR_READ  Supervisor

4        NB_NETWARE_READ     NetWare operating
                             system only

Write Access
Value   #define              Access
0       NB_ANYONE_WRITE      Anyone attached to
                             the server

16      NB_LOGGED_WRITE      Anyone logged in to
                             the server

32      NB_OBJECT_WRITE      Currently logged in
                             user only

48      NB_SUPERVISOR_WRITE  Supervisor

64      NB_NETWARE_WRITE     NetWare operating
                             system only

To assign a read and write level, add a _READ and _WRITE value 
together. For instance, NB_LOGGED_READ + NB_SUPERVISOR_WRITE (1 + 48 = 
49) indicates that anyone logged into the server can access the object, 
but only a supervisor (or equivalent) can modify or delete the object. 
If <nSecurity> is omitted, a level of 0 + 0 (anyone attached to server) 
is assigned.


Example

#include bindery.ch
// Create an object, TEST_USER.
N_B_CREATE('TEST_USER, 1, NB_STATIC,       ;
           NB_LOGGED_READ + NB_OBJECT_WRITE)
// Create an item property.
N_B_PRCREATE('TEST-USER', 1, 'IDENTIFICATION')
// Give it a fullname.
N_B_PRWRITE('TEST-USER', 1, 'IDENTIFICATION', 'Test User')
// Create a set property.
N_B_PRCREATE('TEST-USER', 1, "GROUPS_I'M_IN", NB_SET_PROPERTY)
// Add TEST-USER to group EVERYONE.
N_B_LINK('TEST-USER', 1,  ;
         "GROUPS_I'M_IN", ;
         'EVERYONE', 2    )
N_B_LINK('EVERYONE', 2,   ;
         'GROUP_MEMBERS', ;
         'TEST-USER', 1   )


Files

BINDERY.CH



See Also: N_B_CREATE() N_B_LINK() N_B_PRWRITE()

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