Profiles

Keys

Profile keys are simple user names.

Fields

karma

Karma is increased each time, when someone likes a node created by this
user. Also user losses his karma, when someone dislikes his node. Karma
value can be negative and if karma becomes big enough below zero, then
user automatically will be banned.

User automatically gets more privileges, when his karma becomes bigger.

Possible karma value interpretation, provided numbers means, that user has
specified karma or more to be able to do what is described:

When we need to check for permission, method that is responsible for permission
checking, generates list of keys to check, then gets all defined permissions
and tries to find if any of key in defined order exists in permissions
dictionary.

For example if we want to check if user user1 that is member of group1
and group2 groups, has 'create' permission, to create 'comment' node in
node1 node. Then permissions will be checked in this way:

Generate list of permission keys, to check, in this example we will get this
list of keys:

This list of permission keys is ordered by how permission is specific. Most
specific permissions goes to top of list and least specific to bottom.

Here, first key:

('create', 'owner', None, 'comment'),

checks if user is owner of parent node and if he can create comment node
in that parent node.

Second key:

('create', 'owner', None, None),

checks if user is owner of parent node and if he can create node of any
type.

Then, permissions will be collected from these places and in this order:

Get permissions from node view class.

Get permissions from all ancestors of node instance starting from least
immediate ancestors.

Get permissions from node instance.

Each node view class has possibility to override final set of
permissions.

Each next gathered permissions dictionary will override previous.

Finally all generated keys are checked with collected dictionary.

If we have this collected permissions dictionary:

{
('create', 'all', None, 'comment'): None,
}

Since dictionary returns None value, it means, that creating comments
are not allowed.

If we would have this collected permissions dictionary:

{
('create', 'all', None, 'comment'): 10,
}

This would mean, that only users, that have more or equal karma points that
10, can create comments.

If we would have this collected permissions dictionary:

{
}

This would mean, that no one has any permissions.

Anonymous users

To specify permissions to anonymous users, you must provide None for
all permission (third permission key tuple item):

{
('create', 'all', None, 'comment'): None,
}

This permissions dictionary tells, that anonymous users can not create
comments.

Authenticated users

To specify permissions to authenticated users, you must provide
authenticated value for all:

{
('create', 'all', 'authenticated', 'comment'): 10,
}

This permissions says, that only authenticated users, that has 10 or greater
karma, can create comments.

Permission actions

create

If user can create a child node to this node.

update

If user can update this node.

delete

If user can delete this node.

If user can delete this node and node has children, first permissions of
all children must be checked and if user does not have permission to delete
at least one of children, then he also can not delete this node.