Start to implement permission checks for tree editor and item editor.

Add a new permission "edit_foo" which means "can modify foo content base meta data". This is different than change_foo in that change will allow/forbid accessing the tree editor, but edit_foo will allow/forbid the item editor.
Also filter out available content types according to the user's add permission.

There probably are lots of holes in the permission checks still, so caveat emptor.