Skip to content

Commit b37ba40

Browse files
committed
Merge pull request civicrm#10 from Edzelopez/CIVI-28
CIVI-28 Added check for permissions while search results are being displayed on contribution search, advanced search and contact summary page (Contributions tab)
2 parents 90687c8 + 72f76e8 commit b37ba40

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

templates/CRM/Contribute/Form/ContributionView.tpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<div class="crm-block crm-content-block crm-contribution-view-form-block">
2727
<div class="action-link">
2828
<div class="crm-submit-buttons">
29-
{if call_user_func(array('CRM_Core_Permission','check'), 'edit contributions')}
29+
{if call_user_func(array('CRM_Core_Permission','check'), 'edit contributions') && call_user_func(array('CRM_Core_Permission', 'check'), "edit contributions of type $financial_type")}
3030
{assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context"}
3131
{if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey}
3232
{assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context&key=$searchKey"}
@@ -35,7 +35,7 @@
3535
<div class="icon ui-icon-pencil"></div>{ts}Edit{/ts}</span>
3636
</a>
3737
{/if}
38-
{if call_user_func(array('CRM_Core_Permission','check'), 'delete in CiviContribute')}
38+
{if call_user_func(array('CRM_Core_Permission','check'), 'delete in CiviContribute') && call_user_func(array('CRM_Core_Permission', 'check'), "delete contributions of type $financial_type")}
3939
{assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context"}
4040
{if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey}
4141
{assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context&key=$searchKey"}
@@ -309,15 +309,15 @@
309309
{/if}
310310

311311
<div class="crm-submit-buttons">
312-
{if call_user_func(array('CRM_Core_Permission','check'), 'edit contributions')}
312+
{if call_user_func(array('CRM_Core_Permission','check'), 'edit contributions') && call_user_func(array('CRM_Core_Permission', 'check'), "edit contributions of type $financial_type")}
313313
{assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context"}
314314
{if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey}
315315
{assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context&key=$searchKey"}
316316
{/if}
317317
<a class="button" href="{crmURL p='civicrm/contact/view/contribution' q=$urlParams}" accesskey="e"><span><div
318318
class="icon ui-icon-pencil"></div>{ts}Edit{/ts}</span></a>
319319
{/if}
320-
{if call_user_func(array('CRM_Core_Permission','check'), 'delete in CiviContribute')}
320+
{if call_user_func(array('CRM_Core_Permission','check'), 'delete in CiviContribute') && call_user_func(array('CRM_Core_Permission', 'check'), "delete contributions of type $financial_type")}
321321
{assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context"}
322322
{if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey}
323323
{assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context&key=$searchKey"}

0 commit comments

Comments
 (0)