Improvements related to permissions.

Minor fixes on DatabaseModel, ObjectTableWidget