def _validate_if_user_has_permission(self, db_obj: ModelType, current_user: User) -> None:
        """Validate if the user has permission to access the object.

        Args:
        ----
            db_obj (ModelType): The object to check.
            current_user (User): The current user.

        Raises:
        ------
            PermissionException: If the user does not have the right to access the object.

        """
        if (
            db_obj.created_by_email != current_user.email
            and db_obj.modified_by_email != current_user.email
        ):
            raise PermissionException("User does not have the right to access this object")
Validate if the user has permission to access the object.

        Args:
        ----
            db_obj (ModelType): The object to check.
            current_user (User): The current user.

        Raises:
        ------
            PermissionException: If the user does not have the right to access the object.

        
backend/airweave/crud/_base.py