$mask -= CRM_Core_Action::ENABLE;
$mask -= CRM_Core_Action::DISABLE;
}
+ $mask = $mask & $permissionMask;
}
// Give access to manage case link by copying to MAX_ACTION index temporarily, depending on case permission of user.
$this->assign('display_name_a', $this->_display_name_a);
+ // Check for permissions
+ if (in_array($this->_action, array(CRM_Core_Action::ADD, CRM_Core_Action::UPDATE, CRM_Core_Action::DELETE))) {
+ 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.'));
+ }
+ }
+
// Set page title based on action
switch ($this->_action) {
case CRM_Core_Action::VIEW: