Skip to content

Commit

Permalink
Afform - Export list of synthetic permissions
Browse files Browse the repository at this point in the history
totten committed Dec 9, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent fd2068b commit c4e6b41
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ext/afform/core/afform.php
Original file line number Diff line number Diff line change
@@ -542,6 +542,23 @@ function afform_civicrm_permission_check($permission, &$granted, $contactId) {
}
}

/**
* Implements hook_civicrm_permissionList().
*
* @see CRM_Utils_Hook::permissionList()
*/
function afform_civicrm_permissionList(&$permissions) {
$scanner = Civi::service('afform_scanner');
foreach ($scanner->getMetas() as $name => $meta) {
$permissions['@afform:' . $name] = [
'group' => 'afform',
'title' => ts('Afform: Inherit permission of %1', [
1 => $name,
]),
];
}
}

/**
* Clear any local/in-memory caches based on afform data.
*/

0 comments on commit c4e6b41

Please sign in to comment.