Skip to content

Commit

Permalink
Add permissions for financial_item entity
Browse files Browse the repository at this point in the history
  • Loading branch information
monishdeb committed Jun 4, 2021
1 parent 8250d5d commit ae8ee11
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CRM/Core/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,8 @@ public static function getEntityActionPermissions() {
];
$permissions['line_item'] = $permissions['contribution'];

$permissions['financial_item'] = $permissions['contribution'];

// Payment permissions
$permissions['payment'] = [
'get' => [
Expand Down
15 changes: 15 additions & 0 deletions Civi/Api4/FinancialItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,19 @@
*/
class FinancialItem extends Generic\DAOEntity {

/**
* @see \Civi\Api4\Generic\AbstractEntity::permissions()
* @return array
*/
public static function permissions() {
$permissions = \CRM_Core_Permission::getEntityActionPermissions()['financial_item'] ?? [];


// Merge permissions for this entity with the defaults
return array_merge($permissions, [
'create' => [\CRM_Core_Permission::ALWAYS_DENY_PERMISSION],
'update' => [\CRM_Core_Permission::ALWAYS_DENY_PERMISSION],
]);
}

}

0 comments on commit ae8ee11

Please sign in to comment.