kaolak : documentation previous | next | table of contents 


3.1 Nodes
Every single entity in Kaolak is a node with a unique system ID. All nodes share the following set of properties :
  • type (int)
  • parents (int[])
  • branch (int)
  • permission_read (int[])
  • permission_write (int[])
  • is_group (bool)
  • name (str)
  • locked (bool)

Nodes registered with a type have additional properties eg username, file_path, session_str, etc. See following sections for details.

type

Set by system upon node creation and unwritable by branch users, types are defined in module configuration files, reside in db table node_types and have an associated class definition. So that the following code can be used to create a node subclass object :
Example of types are: 'user', 'branch', 'document', 'session'. Nodes have unique types.
$node     = new Node($nodeId);
$objClass = ucfirst($node->getTypeName(1)); // capitalize node type first letter to get class name
$node     = new $objClass($nodeId);

parents

Nodes can have multiple parents they themselves are parents.
As nodes inherit access permissions from the parent (group) they are in, they get the strongest access permission of the multiple groups they are part of (an admin being a subscriber is still an admin).
The parents field of a node is an array containing the ids of its parent nodes.

branch

The branch is what allows nodes to be grouped and form the domain of the community.
Nodes can be part of several branches so a user can have its own set of documents, in which case he is the admin of that second branch and choose who can view his documents, for example.

permission_read and permission_write

Each node has read and write permissions set by system upon node creation and changeable through parent inheritance.
By default, all nodes are readable by Kaolak loggable users (subscribers, which cannot log into the kaolak GUI don't have access to the community's documents, except for the ones published ie viewable through the community's website). See section 3.3 Permissions for details on Kaolak access permissions design.

is_group

Nodes is_group property exists for the GUI explorer tree to display the right icon for parent nodes whom children have left home.

locked

Nodes locked property prevents users from editing a node whose already being edited, eventhough they have the permission to do so.
Its value is the id of the user editing it. Locks are released when user leaves node editing or logs out of the GUI.
 previous | next | table of contents