added support for user.get_all_permissions(obj)

it seems like the whole function can be refactored to `return isinstance(obj, models.Model)`