mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-28 09:51:36 +00:00
Updated gam create teamdrive to handle the following error:
ERROR: 403: userCannotCreateTeamDrives - The authenticated user cannot create new shared drives.
This commit is contained in:
@@ -2,6 +2,13 @@
|
||||
|
||||
Merged GAM-Team version
|
||||
|
||||
6.63.09
|
||||
|
||||
Updated `gam create teamdrive` to handle the following error:
|
||||
```
|
||||
ERROR: 403: userCannotCreateTeamDrives - The authenticated user cannot create new shared drives.
|
||||
```
|
||||
|
||||
6.63.08
|
||||
|
||||
Updated `cigroup` commands to handle the following error:
|
||||
|
||||
@@ -59874,7 +59874,7 @@ def createSharedDrive(users, useDomainAdminAccess=False):
|
||||
bailOnTransientError=True,
|
||||
throwReasons=GAPI.DRIVE_USER_THROW_REASONS+[GAPI.TRANSIENT_ERROR, GAPI.TEAMDRIVE_ALREADY_EXISTS,
|
||||
GAPI.INSUFFICIENT_PERMISSIONS, GAPI.INSUFFICIENT_FILE_PERMISSIONS,
|
||||
GAPI.DUPLICATE, GAPI.BAD_REQUEST],
|
||||
GAPI.DUPLICATE, GAPI.BAD_REQUEST, GAPI.USER_CANNOT_CREATE_TEAMDRIVES],
|
||||
requestId=requestId, body=body, fields='id')
|
||||
driveId = shareddrive['id']
|
||||
if returnIdOnly:
|
||||
@@ -59897,7 +59897,7 @@ def createSharedDrive(users, useDomainAdminAccess=False):
|
||||
except GAPI.duplicate:
|
||||
entityActionFailedWarning([Ent.USER, user, Ent.REQUEST_ID, requestId], Msg.DUPLICATE, i, count)
|
||||
break
|
||||
except (GAPI.insufficientPermissions, GAPI.insufficientFilePermissions, GAPI.badRequest) as e:
|
||||
except (GAPI.insufficientPermissions, GAPI.insufficientFilePermissions, GAPI.badRequest, GAPI.userCannotCreateTeamDrives) as e:
|
||||
entityActionFailedWarning([Ent.USER, user, Ent.REQUEST_ID, requestId], str(e), i, count)
|
||||
break
|
||||
except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
|
||||
|
||||
@@ -165,6 +165,7 @@ TIME_RANGE_EMPTY = 'timeRangeEmpty'
|
||||
TRANSIENT_ERROR = 'transientError'
|
||||
UNKNOWN_ERROR = 'unknownError'
|
||||
UPLOAD_TOO_LARGE = 'uploadTooLarge'
|
||||
USER_CANNOT_CREATE_TEAMDRIVES = 'userCannotCreateTeamDrives'
|
||||
USER_ACCESS = 'userAccess'
|
||||
USER_NOT_FOUND = 'userNotFound'
|
||||
USER_RATE_LIMIT_EXCEEDED = 'userRateLimitExceeded'
|
||||
@@ -613,6 +614,8 @@ class unknownError(Exception):
|
||||
pass
|
||||
class uploadTooLarge(Exception):
|
||||
pass
|
||||
class userCannotCreateTeamDrives(Exception):
|
||||
pass
|
||||
class userAccess(Exception):
|
||||
pass
|
||||
class userNotFound(Exception):
|
||||
@@ -763,6 +766,7 @@ REASON_EXCEPTION_MAP = {
|
||||
TRANSIENT_ERROR: transientError,
|
||||
UNKNOWN_ERROR: unknownError,
|
||||
UPLOAD_TOO_LARGE: uploadTooLarge,
|
||||
USER_CANNOT_CREATE_TEAMDRIVES: userCannotCreateTeamDrives,
|
||||
USER_ACCESS: userAccess,
|
||||
USER_NOT_FOUND: userNotFound,
|
||||
USER_RATE_LIMIT_EXCEEDED: userRateLimitExceeded,
|
||||
|
||||
Reference in New Issue
Block a user