def has_object_permission(self, request, view, obj):  # type: ignore[no-untyped-def]
        """Check if user has permission to view / edit / delete project"""
        if request.user.is_project_admin(obj):
            return True

        if view.action == "retrieve" and request.user.has_project_permission(
            VIEW_PROJECT, obj
        ):
            return True

        if view.action in ["user_permissions", "detailed_permissions"]:
            return True

        return False
Check if user has permission to view / edit / delete project
api/projects/permissions.py