templates/base.html: username w/links to all pages

[ui feature]

Added a "top bar" section to all pages that displays:
- user name and logout link for authenticated users,
- login and register links for anonymous users.
views: removed debugging line

[tidy]

This is probably not needed any more.
Added visibility and user rights to heap page

[access control]

This is a first step towards enforcing access control. Besides the UI part,
methods were added to the Heap model to list users and to get the effective
(i.e. highest) access level of a user to the heap.
Implemented access control

[access control]

True access control is in place now. Message and Heap models have been
extended with convenience functions. All views now perform their
adequate access control checks, with the form-based views performing
double checks, one for displaying the form, the other, stricter one
before actually performing the change.

The access control functions are actually quite similar, very probably
many lines could be saved by making a useful make_access_controller
function that would cover most of the cases.
models: superuser now handled as effective right

[access control]

Before it was only handled in `check_access`. The reason for the change is that
this way, we can use `get_effective_userright` to list the heaps accessible to
the users, and it will work correctly for superusers (as they have access to
all heaps).
Only accessible heaps displayed to users

[access control]

Previously all heaps were shown to all users for the Heap view, and there was
only a TODO message in the front view.
models, views: rights, visibility displayed as text

[access control]

User rights are displayed in textual form on heap pages. In order to achieve
this, a class method was added to the `UserRight` model that returns the
display string for arbitrary right IDs (`get_right_display` only works on
instances, whereas no `UserRight` instance belongs to non-asserted rights that
are derived from heap visibility or the user's superuser status).

Also, rights granted to 'everyone else' due to heap visibility are displayed.
Heapadmins can remove user rights from the UI

[ui feature]

As a side effect, the generic view framework has been extended to handle two
arguments. (The `deleteright` view needs one for the user and one for the
heap.)

This could be handled more conveniently using AJAX, but it is usable.
Grammatically correct 'everyone else' message

[ui feature]

Just a minor touch: 'everyone else' did not look right when there were no lines
preceding it. In such cases, we just display 'everyone' instead.
UI for adding user rights to heaps

[ui feature]

Includes several related changes and adding the missing `delright.html`
template from a previous commit.
Exceptions caused by missing user ID fixed

[bugfix]

The last entry for the 'everyone else' part did not contain a user ID,
therefore it caused exceptions with reverse `delright` lookup.
Replaced IntegerFields with ModelChoiceFields

[ui feature]

Choosing from a list is more user-friendly than having to type in an ID number.
However, once item counts reach the hundreds, things will be complicated, and
an AJAX-based entry mechanism will be needed anyway.
models: removed debug statements

[access control]

One of these caused an exception for anonymous users. Access control seems stable now, so I remove them.
Fixed bugs due to changed forms

[bugfix]

The new forms using `ModelChoiceField` yield model objects instead of their
IDs. This has not been corrected then, which resulted in several views raising
exceptions.
Merge pull request #2 from attish/master

Access control implemented