'CiviMember' => 'edit memberships',
'CiviPledge' => 'edit pledges',
'CiviContribute' => 'edit contributions',
- 'CiviGrant' => 'edit grants',
'CiviMail' => 'access CiviMail',
'CiviAuction' => 'add auction items',
];
$title = CRM_Contact_BAO_Contact::displayName($grant->contact_id) . ' - ' . ts('Grant') . ': ' . $grantTypes[$grant->grant_type_id];
$recentOther = [];
- if (CRM_Core_Permission::checkActionPermission('CiviGrant', CRM_Core_Action::UPDATE)) {
+ if (CRM_Core_Permission::check('edit grants')) {
$recentOther['editUrl'] = CRM_Utils_System::url('civicrm/contact/view/grant',
"action=update&reset=1&id={$grant->id}&cid={$grant->contact_id}&context=home"
);
}
- if (CRM_Core_Permission::checkActionPermission('CiviGrant', CRM_Core_Action::DELETE)) {
+ if (CRM_Core_Permission::check('delete in CiviGrant')) {
$recentOther['deleteUrl'] = CRM_Utils_System::url('civicrm/contact/view/grant',
"action=delete&reset=1&id={$grant->id}&cid={$grant->contact_id}&context=home"
);
$this->assign('action', $this->_action);
$this->assign('context', $this->_context);
- //check permission for action.
- if (!CRM_Core_Permission::checkActionPermission('CiviGrant', $this->_action)) {
+ // check permission for action.
+ $perm = $this->_action & CRM_Core_Action::DELETE ? 'delete in CiviGrant' : 'edit grants';
+ if (!CRM_Core_Permission::check($perm)) {
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
$title = CRM_Contact_BAO_Contact::displayName($values['contact_id']) . ' - ' . ts('Grant') . ': ' . CRM_Utils_Money::format($values['amount_total']) . ' (' . $grantType[$values['grant_type_id']] . ')';
$recentOther = [];
- if (CRM_Core_Permission::checkActionPermission('CiviGrant', CRM_Core_Action::UPDATE)) {
+ if (CRM_Core_Permission::check('edit grants')) {
$recentOther['editUrl'] = CRM_Utils_System::url('civicrm/contact/view/grant',
"action=update&reset=1&id={$values['id']}&cid={$values['contact_id']}&context=home"
);
}
- if (CRM_Core_Permission::checkActionPermission('CiviGrant', CRM_Core_Action::DELETE)) {
+ if (CRM_Core_Permission::check('delete in CiviGrant')) {
$recentOther['deleteUrl'] = CRM_Utils_System::url('civicrm/contact/view/grant',
"action=delete&reset=1&id={$values['id']}&cid={$values['contact_id']}&context=home"
);
parent::preProcess();
//check permission for delete.
- if (!CRM_Core_Permission::checkActionPermission('CiviGrant', CRM_Core_Action::DELETE)) {
+ if (!CRM_Core_Permission::check('delete in CiviGrant')) {
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
}
parent::preProcess();
//check permission for update.
- if (!CRM_Core_Permission::checkActionPermission('CiviGrant', CRM_Core_Action::UPDATE)) {
+ if (!CRM_Core_Permission::check('edit grants')) {
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
}