Commit 8f0ff164 authored by Rich's avatar Rich

Implement permission for admin UI

parent 7ecf9f11
......@@ -8,4 +8,19 @@ namespace Civi\Api4;
* @package Civi\Api4
*/
class ActionLink extends Generic\DAOEntity {
/**
* By default, require our 'administer action links extension' permission.
*
* Allow creating the links for anyone who can access CiviCRM, as this will
* include CiviMail etc.
*
* @return array
*/
public static function permissions() {
return [
'default' => ['administer action links extension'],
'getLink' => ['access CiviCRM'],
];
}
}
<div class="crm-container">
<h1 crm-page-title>{{ts('Action Links')}}</h1>
<div ng-if="!isLoaded">Loading...</div>
<div ng-if="!isLoaded">
<p ng-if="!error">Loading...</p>
<div class="messages error messages-error" ng-if="error">{{error}}</div>
</div>
<div ng-if="isLoaded">
<div ng-if="view == 'list'">
......
......@@ -53,12 +53,11 @@
crmApi4('ActionLink', 'get', {
orderBy: {"is_active":"DESC", "name":"ASC"}
}).then(function(actionLinks) {
// do something with actionLinks array
console.log("actionLinks", actionLinks);
$scope.actionLinks = actionLinks;
$scope.isLoaded = true;
}, function(failure) {
console.error(failure);
$scope.error = "Failed to load Activity Links. Do you have the 'administer activity links extension' permission?";
});
crmApi('FormProcessorInstance', 'get', {
......@@ -76,7 +75,7 @@
$scope.formProcessorInstalled = true;
})
.catch(function(e) {
console.log("no form processor");
console.log("no form processor (that's probably fine)");
$scope.formProcessorInstalled = false;
$scope.formProcessorInstances = [];
});
......
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