Permissions

Added permission-checkin functions.
Views check for model-level permissions.
Action buttons in views are shown only iff the user has necessary permissions.