This repository has been archived by the owner on May 13, 2018. It is now read-only.
forked from hugowetterberg/services_oauth
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added created and changed timestamps for tokens and consumers.
In the process of adding support for editing authorizations. In the process of adding support for authorization levels.
- Loading branch information
1 parent
3e9eecb
commit ff7bb9c
Showing
4 changed files
with
192 additions
and
3 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,2 +1,42 @@ | ||
<?php | ||
// $Id$ | ||
|
||
function services_oauth_install() { | ||
drupal_install_schema('services_oauth'); | ||
|
||
// Create default authorization levels | ||
$insert = "INSERT INTO {services_oauth_authorization_levels}(name, title) VALUES('%s','%s')"; | ||
db_query($insert, array(':name' => 'read', ':title' => 'Read access')); | ||
db_query($insert, array(':name' => 'update', ':title' => 'Update access')); | ||
db_query($insert, array(':name' => 'create', ':title' => 'Create access')); | ||
db_query($insert, array(':name' => 'delete', ':title' => 'Delete access')); | ||
} | ||
|
||
function services_oauth_uninstall() { | ||
drupal_uninstall_schema('services_oauth'); | ||
} | ||
|
||
function services_oauth_schema() { | ||
$schema = array(); | ||
|
||
$schema['services_oauth_authorization_levels'] = array( | ||
'description' => t('Stores the different authorization levels that are available for access tokens.'), | ||
'fields' => array( | ||
'name' => array( | ||
'description' => t('The computer-readable name of the authorization level.'), | ||
'type' => 'varchar', | ||
'length' => 32, | ||
'not null' => TRUE, | ||
), | ||
'title' => array( | ||
'description' => t('The localizable title of the authorization level.'), | ||
'type' => 'varchar', | ||
'length' => 255, | ||
'not null' => TRUE, | ||
), | ||
), | ||
'primary key' => array('name'), | ||
); | ||
|
||
return $schema; | ||
} |
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
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