Add constant google api scopes

This commit is contained in:
Marco A. Nina Mena
2015-12-19 22:29:48 -04:00
parent ad8836199c
commit 4172812860
2 changed files with 34 additions and 24 deletions

View File

@@ -9,6 +9,15 @@ require_once PATH_TRUNK . 'vendor' . PATH_SEP . 'google' . PATH_SEP . 'apiclient
class PMGoogleApi
{
const DRIVE = 'https://www.googleapis.com/auth/drive';
const DRIVE_FILE = 'https://www.googleapis.com/auth/drive.file';
const DRIVE_APPS_READONLY = 'https://www.googleapis.com/auth/drive.apps.readonly';
const DRIVE_READONLY = 'https://www.googleapis.com/auth/drive.readonly';
const DRIVE_METADATA = 'https://www.googleapis.com/auth/drive.metadata';
const DRIVE_METADATA_READONLY = 'https://www.googleapis.com/auth/drive.metadata.readonly';
const DRIVE_APPDATA = 'https://www.googleapis.com/auth/drive.appdata';
const DRIVE_PHOTOS_READONLY = 'https://www.googleapis.com/auth/drive.photos.readonly';
private $scope = array();
private $serviceAccountEmail;
private $serviceAccountP12;
@@ -244,13 +253,13 @@ class PMGoogleApi
{
$scope = array(
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/drive.readonly',
'https://www.googleapis.com/auth/drive.metadata.readonly',
'https://www.googleapis.com/auth/drive.appdata',
'https://www.googleapis.com/auth/drive.metadata',
'https://www.googleapis.com/auth/drive.photos.readonly'
static::DRIVE,
static::DRIVE_FILE,
static::DRIVE_READONLY,
static::DRIVE_METADATA,
static::DRIVE_METADATA_READONLY,
static::DRIVE_APPDATA,
static::DRIVE_PHOTOS_READONLY
);
if ($credentials->typeAuth == 'webApplication') {