Skip to content

Commit

Permalink
Allow anyone to access PostcodeAT.get/getstate/getatstate API functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Aug 2, 2017
1 parent 55e6b67 commit 0b88f74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<url desc="Main Extension Page">https://github.com/systopia/de.systopia.postcodeat</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2017-07-25</releaseDate>
<version>1.0.beta2</version>
<releaseDate>2017-08-02</releaseDate>
<version>1.0.beta3</version>
<develStage>beta</develStage>
<compatibility>
<ver>4.6</ver>
Expand Down
10 changes: 8 additions & 2 deletions postcodeat.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,14 @@ function postcodeat_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
}

function postcodeat_civicrm_alterAPIPermissions($entity, $action, &$params, &$permissions) {
if ((strtolower($entity) == strtolower('postcode_a_t') || strtolower($entity) == strtolower('PostcodeAT')) && $action == 'get') {
$params['check_permissions'] = false; //allow everyone to use the postcode api
if (strtolower($entity) == strtolower('postcode_a_t') || strtolower($entity) == strtolower('PostcodeAT')) {
switch ($action) {
case 'get':
case 'getatstate':
case 'getstate':
$params['check_permissions'] = FALSE; //allow everyone to use the postcode api
break;
}
}
}

Expand Down

0 comments on commit 0b88f74

Please sign in to comment.