// check for permissions
$session = CRM_Core_Session::singleton();
- if ($session->get('userID') != $this->_contactId &&
- !CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::EDIT)
- ) {
+ if (!CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::EDIT)) {
CRM_Core_Error::statusBounce(ts('You do not have the necessary permission to edit this contact.'));
}
'isDeleted' => $isDeleted,
);
- if (($session->get('userID') == $this->_contactId) ||
+ if (
CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::EDIT)
) {
$recentOther['editUrl'] = CRM_Utils_System::url('civicrm/contact/add', "reset=1&action=update&cid={$this->_contactId}");
// things easier in dashboard
$session = CRM_Core_Session::singleton();
- if ($session->get('userID') == $contactID) {
+ if ($session->get('userID') == $contactID && CRM_Core_Permission::check('edit my contact')) {
$page->assign('permission', 'edit');
$page->_permission = CRM_Core_Permission::EDIT;
// deleted contacts’ stuff should be (at best) only viewable