Commit 5c91c7ff authored by jaapjansma's avatar jaapjansma
Browse files

* Fixed issue with Unauthorized API access.

parent e07563be
Version 1.3.0
--------------
* Fixed issue with Unauthorized API access.
Version 1.2.0
--------------
......
......@@ -10,4 +10,24 @@ namespace Civi\Api4;
*/
class Expense extends Generic\DAOEntity {
/**
* Returns a list of permissions needed to access the various actions in this api.
*
* @return array
*/
public static function permissions() {
$permissions = \CRM_Core_Permission::getEntityActionPermissions();
// For legacy reasons the permissions are keyed by lowercase entity name
$lcentity = \CRM_Core_DAO_AllCoreTables::convertEntityNameToLower(self::getEntityName());
if (!isset($permissions[$lcentity])) {
$permissions[$lcentity] = [
'default' => 'manage expenses',
'meta' => 'manage expenses'
];
}
// Merge permissions for this entity with the defaults
return ($permissions[$lcentity] ?? []) + $permissions['default'];
}
}
......@@ -10,4 +10,24 @@ namespace Civi\Api4;
*/
class ExpenseLine extends Generic\DAOEntity {
/**
* Returns a list of permissions needed to access the various actions in this api.
*
* @return array
*/
public static function permissions() {
$permissions = \CRM_Core_Permission::getEntityActionPermissions();
// For legacy reasons the permissions are keyed by lowercase entity name
$lcentity = \CRM_Core_DAO_AllCoreTables::convertEntityNameToLower(self::getEntityName());
if (!isset($permissions[$lcentity])) {
$permissions[$lcentity] = [
'default' => 'manage expenses',
'meta' => 'manage expenses'
];
}
// Merge permissions for this entity with the defaults
return ($permissions[$lcentity] ?? []) + $permissions['default'];
}
}
......@@ -13,8 +13,8 @@
<url desc="Documentation">https://lab.civicrm.org/extensions/expenses/blob/master/README.md</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2021-02-15</releaseDate>
<version>1.2.0</version>
<releaseDate>2021-05-26</releaseDate>
<version>1.3.0</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.0</ver>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment