Revert "Revert "Removed the permission error checks""

This reverts commit 58a2592321cd843d0cf647c1a9a71958281870a7.
Revert "Revert "Revert "Removed the permission error checks"""

This reverts commit e1bce6e8bd6ba2215efe48570015fbf57ce9d90c.