add permissions enforcement for models
fix ensure_permission