Merge "Enforce permission check before identity clear"