"You might get this error when you try to use your scanner from within Image Capture, Preview, or Printers & Scanners preferences."
Apple has published a supporting document on it website that fixes an error reported by many users while trying to open the scanner from within Image Capture, Preview, or Printers & Scanners preferences.
When attempting to connect to your scanner and begin a scan, you might get a message that:
-"you do not have permission to open the application "HP Scanner", contact your computer or network administrator for assistance"
-failed to open a connection to the device (-21345).
Apple suggests to use the following steps to fix this problem:
They promised to fix this issue in a future software update.