Whitebeam Template Reference Documentation
Associates an entity (OU or individual) with a different parent OU or a community.
number = rb.contact.link(target, container, force)
The 'link' method takes 3 parameters:
|Name ||Type/Value ||Range/Length ||Description |
|target||number||integer, valid ID ||Required. The ID of the OU or individual to be attached to a new parent (higher up the organisational heirarchy) |
|container||number|| ||Required. The ID of the community or OU to associate target with.|
|force||bool|| ||Optional, default = 0|
If this is true then the parent is changed regardless of the current parent setting (no need to call 'unlink' first.
The 'link' method returns number:
|Type/Value ||Range/Length ||Description |
|| ||ID of the container entity, or -1 if the link failed|
link() is used to associate individuals with both parent OUs or communities.
Allowable combinations are:
- An individual may be linked to a parent OU (in which case it inherits membership of that OU, its parents and community memberships).
- An individual may be linked directly to a community
- An OU may be linked to a parent OU (in which case all direct and indirect children become indirect members of the parent OU, its parents and any communities of which it is a member).
- An OU may be linked to a community (in which case all direct and indirect children become members of the community by inheritance as long as they remain linked to the OU)
The following links the user "fred" with the OU "mega", it then links "mega" to the community "friends" which has the effect of making all children of mega, including fred, members of friends
fred = rb.contact.individualInfo(-1, "fred");
mega = rb.contact.OUInfo(-1, "mega")
friends = rb.contact.communityInfo(-1, "friends");
if(rb.contact.link(fred.ID, mega.ID) < 0))
rb.page.write("link returned error");
(loadtime : 187ms)