-
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to allow adding oauth clients via hook_farm_oauth_client, an…
…d enable via system settings form.
- Loading branch information
Showing
2 changed files
with
218 additions
and
17 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
modules/farm/farm_api/farm_api_oauth/farm_api_oauth.farm_access.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* @file | ||
* Farm Access hooks implemented by farm_api_oauth module. | ||
*/ | ||
|
||
/** | ||
* Implements hook_farm_access_perms(). | ||
*/ | ||
function farm_api_oauth_farm_access_perms($role) { | ||
// Load the list of farm roles. | ||
$roles = farm_access_roles(); | ||
|
||
if (!empty($roles[$role]['access']['config'])) { | ||
return array('administer oauth clients'); | ||
} | ||
else { | ||
return array(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters