Skip to content

Commit

Permalink
Merge pull request #17540 from colemanw/getActionsPerm
Browse files Browse the repository at this point in the history
APIv4 - filter getActions results based on user permissions
  • Loading branch information
eileenmcnaughton authored Jun 8, 2020
2 parents c02d2eb + 7e67fdb commit 10ba4c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Civi/Api4/Action/GetActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private function loadAction($actionName, $method = NULL) {
try {
if (!isset($this->_actions[$actionName]) && (!$this->_actionsToGet || in_array($actionName, $this->_actionsToGet))) {
$action = \Civi\API\Request::create($this->getEntityName(), $actionName, ['version' => 4]);
if (is_object($action)) {
if (is_object($action) && (!$this->checkPermissions || $action->isAuthorized())) {
$this->_actions[$actionName] = ['name' => $actionName];
if ($this->_isFieldSelected('description', 'comment', 'see')) {
$vars = ['entity' => $this->getEntityName(), 'action' => $actionName];
Expand Down

0 comments on commit 10ba4c7

Please sign in to comment.