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_link( <cowner>, <ntype>, http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_B_LINK( <cOwner>, <nType>, 
          <cProperty>, 
          <cMember>, <nType> )


Parameters

<cOwner>
Name of the owner object.

<nType>
Type of the owner object.

<cProperty>
Set property of the owner.

<cMember>
Name of member object to be linked.

<nType>
Type of member object.


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

The member object will be connected to the owner object via the 
specified set property.

When adding a user to a group, you must link the user to the group's 
GROUP_MEMBERS set in addition to linking the group to the user's 
GROUPS_I'M_IN set. The bi-directional connection is not automatic.

Let's say, for example, that you want to link a user object named DAVID 
to the group object EVERYONE. The operation will require two steps, the 
first to link EVERYONE to DAVID, and the second to link DAVID to 
EVERYONE.

The first step, linking DAVID to EVERYONE, makes the connection through 
DAVID's property GROUPS_I'M_IN. The code to do this is:

N_B_LINK('DAVID',         ;  // <cOwner>
         1,               ;  // <nType>
         "GROUPS_I'M_IN", ;  // <cProperty>
         'EVERYONE',      ;  // <cMember>
         2                )  // <nType>

The second step, linking EVERYONE to DAVID, makes the connection 
through GROUP_MEMBERS, a property of the group object EVERYONE. The 
code to do this is:

N_B_LINK('EVERYONE',      ;  // <cOwner>
         2,               ;  // <nType>
         'GROUP_MEMBERS', ;  // <cProperty>
         'DAVID',         ;  // <cMember>
         1                )  // <nType>

The properties used to forge the link must already exist or must be 
created with N_B_PRCREATE(). If a property does not exist, or if it is 
not a set property, or if either object does not exist, no action will 
be taken.

NetWare also expects that when you add a user to a group you will 
create and link the set property SECURITY_EQUALS.

Note  You must have write access in order to modify a property.

Commonly used set properties and object types are listed below.

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

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 corre-
                              sponding entry in a 
                              GROUPS_I'M_IN set.

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

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

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

SECURITY_EQUALS     User      User/group with same 
                              security level.

OPERATORS           File srvr Console operators.


Examples

// Connect TEST-USER to group EVERYONE.
N_B_LINK('TEST-USER', 1,  ;  // Owner
         "GROUPS_I'M_IN", ;  // Set 
         'EVERYONE', 2    )  // Member

// Connect group EVERYONE to TEST-USER.
N_B_LINK('EVERYONE', 2,   ;  // Owner
         'GROUP_MEMBERS', ;  // Set
         'TEST-USER', 1   )  // Member
// Add a member to set SECURITY_EQUALS
N_B_LINK('TEST-USER', 1,   ; // Owner
         'SECURITY_EQUALS, ; // Set 
         'EVERYONE', 2     ) // Member

// Add a group to a print queue's set Q_USERS.
N_B_LINK('HPLASER', 3, ;      // Owner
         'Q_USERS',    ;      // Set
         'EVERYONE', 2)       // Member



See Also: N_B_PRCREATE() N_B_UNLINK()

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