Instead of failing, remove history logs that user can't see

Also, the permission check ignored all entries but the last.

Change-Id: Idc0e2a554a297e96d68b382b59e0876d91a7e883
(cherry picked from commit 1fa19be8046e77cd6b6e9bdf5d90dec2a85388bc)
Merge "Instead of failing, remove history logs that user can't see"