Fix warning when user doesn't have edit permissions.
https://github.com/civicrm/civicrm-core/pull/6905
PR: civicrm-core#6905: Fix warning when user doesn't have edit permissions