my company used BitBucket Cloud.
I know that I can configure branch permissions to disable re-writing history based on a regex-list pattern.

However, I want to allow the developers to rewrite branch history to their hearts content, and prevent it if, and only if, that branch is the source branch of a Pull Request. We have Merge check configure to not merge if there are open bitbucket tasks against the PR.
Here's the workflow:
User #1.
- Create a branch on the remote server.
- Commit, commit, commit and push
- Commit, push
- Perform interactive rebase and squash all commit into a single one. git push
- Create a PR and add user #2
User #2:
- Open PR.
- Adds a few BitBucket tasks and approves
User #1:
- Addresses the comments. Does it git commit
- Before pushing an update, does a git rebase and update the branch history <<< I want this to fail because a PR is open againt the branch
- Pushes the changes
User #2:
- Received an notification PR has been updated.
- Opens the PR and goes to the "Activity" tab.
- Search for the "User #1 approved" message and select the "See what's changed link"

- User freaks out because the diff shows code changes unrelated to the "fix"
When this happens, the commit that was approved no longer appears in the PR "commits" view.
Is it possible to disable rewriting the branch history if, and only if, a branch has an open PR against it?