mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
Update Shared Drive restriction settings
This commit is contained in:
@@ -4860,8 +4860,8 @@ gam <UserTypeEntity> sendemail from <EmailAddress>
|
|||||||
allowcontentmanagerstosharefolders|
|
allowcontentmanagerstosharefolders|
|
||||||
copyrequireswriterpermission|
|
copyrequireswriterpermission|
|
||||||
domainusersonly|
|
domainusersonly|
|
||||||
downloadrestrictedforreaders|
|
downloadrestrictedforreaders|downloadrestrictions.restrictedforreaders|
|
||||||
downloadrestrictedforwriters|
|
downloadrestrictedforwriters|downloadrestrictions.restrictedforwriters|
|
||||||
drivemembersonly|teammembersonly|
|
drivemembersonly|teammembersonly|
|
||||||
sharingfoldersrequiresorganizerpermission
|
sharingfoldersrequiresorganizerpermission
|
||||||
|
|
||||||
@@ -4878,7 +4878,7 @@ In these commands, the Google administrator named in oauth2.txt is used.
|
|||||||
gam show shareddrivethemes
|
gam show shareddrivethemes
|
||||||
gam create shareddrive <Name>
|
gam create shareddrive <Name>
|
||||||
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
|
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
|
||||||
(<SharedDriveRestrictionsSubfieldName> <Boolean>)*
|
([restrictions.]<SharedDriveRestrictionsSubfieldName> <Boolean>)*
|
||||||
[hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
|
[hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
|
||||||
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
|
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
|
||||||
[movetoorgunitdelay <Integer>]
|
[movetoorgunitdelay <Integer>]
|
||||||
@@ -4932,7 +4932,7 @@ In these commands, you specify an administrator and then indicate that you want
|
|||||||
|
|
||||||
gam <UserTypeEntity> create shareddrive <Name> adminaccess
|
gam <UserTypeEntity> create shareddrive <Name> adminaccess
|
||||||
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
|
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
|
||||||
(<SharedDriveRestrictionsSubfieldName> <Boolean>)*
|
([restrictions.]<SharedDriveRestrictionsSubfieldName> <Boolean>)*
|
||||||
[hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
|
[hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
|
||||||
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
|
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
|
||||||
[movetoorgunitdelay <Integer>]
|
[movetoorgunitdelay <Integer>]
|
||||||
@@ -4966,7 +4966,7 @@ In these commands, you specify a user, administrator access is not used.
|
|||||||
|
|
||||||
gam <UserTypeEntity> create shareddrive <Name>
|
gam <UserTypeEntity> create shareddrive <Name>
|
||||||
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
|
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
|
||||||
(<SharedDriveRestrictionsSubfieldName> <Boolean>)*
|
([restrictions.]<SharedDriveRestrictionsSubfieldName> <Boolean>)*
|
||||||
[hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
|
[hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
|
||||||
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
|
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
|
||||||
[movetoorgunitdelay <Integer>]
|
[movetoorgunitdelay <Integer>]
|
||||||
@@ -8475,8 +8475,8 @@ gam <UserTypeEntity> print tasklists [todrive <ToDriveAttribute>*]
|
|||||||
allowcontentmanagerstosharefolders|
|
allowcontentmanagerstosharefolders|
|
||||||
copyrequireswriterpermission|
|
copyrequireswriterpermission|
|
||||||
domainusersonly|
|
domainusersonly|
|
||||||
downloadrestrictedforreaders|
|
downloadrestrictedforreaders|downloadrestrictions.restrictedforreaders|
|
||||||
downloadrestrictedforwriters|
|
downloadrestrictedforwriters|downloadrestrictions.restrictedforwriters|
|
||||||
drivemembersonly|teammembersonly|
|
drivemembersonly|teammembersonly|
|
||||||
sharingfoldersrequiresorganizerpermission
|
sharingfoldersrequiresorganizerpermission
|
||||||
|
|
||||||
@@ -8491,13 +8491,13 @@ sharingfoldersrequiresorganizerpermission true
|
|||||||
gam <UserTypeEntity> show shareddrivethemes
|
gam <UserTypeEntity> show shareddrivethemes
|
||||||
gam <UserTypeEntity> create shareddrive <Name>
|
gam <UserTypeEntity> create shareddrive <Name>
|
||||||
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
|
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
|
||||||
(<SharedDriveRestrictionsSubfieldName> <Boolean>)*
|
([restrictions.]<SharedDriveRestrictionsSubfieldName> <Boolean>)*
|
||||||
[hide|hidden <Boolean>]
|
[hide|hidden <Boolean>]
|
||||||
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
|
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
|
||||||
[(csv [todrive <ToDriveAttribute>*] (addcsvdata <FieldName> <String>)*) | returnidonly]
|
[(csv [todrive <ToDriveAttribute>*] (addcsvdata <FieldName> <String>)*) | returnidonly]
|
||||||
gam <UserTypeEntity> update shareddrive <SharedDriveEntity> [name <Name>]
|
gam <UserTypeEntity> update shareddrive <SharedDriveEntity> [name <Name>]
|
||||||
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
|
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
|
||||||
(<SharedDriveRestrictionsSubfieldName> <Boolean>)*
|
([restrictions.]<SharedDriveRestrictionsSubfieldName> <Boolean>)*
|
||||||
[hide|hidden <Boolean>]
|
[hide|hidden <Boolean>]
|
||||||
gam <UserTypeEntity> delete shareddrive <SharedDriveEntity>
|
gam <UserTypeEntity> delete shareddrive <SharedDriveEntity>
|
||||||
[allowitemdeletion]
|
[allowitemdeletion]
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
7.15.01
|
||||||
|
|
||||||
|
Added `downloadrestrictions.restrictedforreaders` and `downloadrestrictions.restrictedforwriters`
|
||||||
|
to `<SharedDriveRestrictionsSubfieldName>`; previously, only the abbreviations `downloadrestrictedforreaders`
|
||||||
|
and `downloadrestrictedforwriters` were supported (they are still supported).
|
||||||
|
|
||||||
7.15.00
|
7.15.00
|
||||||
|
|
||||||
Updated `gam print shareddriveorganizers` to make `shownoorganizerdrives` default to `True`
|
Updated `gam print shareddriveorganizers` to make `shownoorganizerdrives` default to `True`
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||||
__version__ = '7.15.00'
|
__version__ = '7.15.01'
|
||||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||||
|
|
||||||
#pylint: disable=wrong-import-position
|
#pylint: disable=wrong-import-position
|
||||||
@@ -60309,7 +60309,7 @@ def _checkForExistingShortcut(drive, fileId, fileName, parentId):
|
|||||||
supportsAllDrives=True, includeItemsFromAllDrives=True,
|
supportsAllDrives=True, includeItemsFromAllDrives=True,
|
||||||
q=f"shortcutDetails.targetId = '{fileId}' and trashed = False", fields='files(id,name,parents)')['files']
|
q=f"shortcutDetails.targetId = '{fileId}' and trashed = False", fields='files(id,name,parents)')['files']
|
||||||
for shortcut in existingShortcuts:
|
for shortcut in existingShortcuts:
|
||||||
if parentId in shortcut['parents'] and fileName == shortcut['name']:
|
if parentId in shortcut.get('parents', []) and fileName == shortcut['name']:
|
||||||
return shortcut['id']
|
return shortcut['id']
|
||||||
except (GAPI.invalidQuery, GAPI.invalid, GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy):
|
except (GAPI.invalidQuery, GAPI.invalid, GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy):
|
||||||
pass
|
pass
|
||||||
@@ -65885,6 +65885,10 @@ SHAREDDRIVE_RESTRICTIONS_MAP = {
|
|||||||
'sharingfoldersrequiresorganizerpermission': 'sharingFoldersRequiresOrganizerPermission',
|
'sharingfoldersrequiresorganizerpermission': 'sharingFoldersRequiresOrganizerPermission',
|
||||||
'teammembersonly': 'driveMembersOnly',
|
'teammembersonly': 'driveMembersOnly',
|
||||||
}
|
}
|
||||||
|
SHAREDDRIVE_DOWNLOAD_RESTRICTIONS_MAP = {
|
||||||
|
'restrictedforreaders': 'downloadrestrictedforreaders',
|
||||||
|
'restrictedforwriters': 'downloadrestrictedforwriters',
|
||||||
|
}
|
||||||
|
|
||||||
def _getSharedDriveRestrictions(myarg, body):
|
def _getSharedDriveRestrictions(myarg, body):
|
||||||
def _setRestriction(restriction):
|
def _setRestriction(restriction):
|
||||||
@@ -65899,7 +65903,12 @@ def _getSharedDriveRestrictions(myarg, body):
|
|||||||
|
|
||||||
if myarg.startswith('restrictions.'):
|
if myarg.startswith('restrictions.'):
|
||||||
_, subField = myarg.split('.', 1)
|
_, subField = myarg.split('.', 1)
|
||||||
if subField in SHAREDDRIVE_RESTRICTIONS_MAP:
|
if subField.startswith('downloadrestrictions.'):
|
||||||
|
_, subField = subField.split('.', 1)
|
||||||
|
if subField in SHAREDDRIVE_DOWNLOAD_RESTRICTIONS_MAP:
|
||||||
|
_setRestriction(SHAREDDRIVE_DOWNLOAD_RESTRICTIONS_MAP[subField])
|
||||||
|
return True
|
||||||
|
elif subField in SHAREDDRIVE_RESTRICTIONS_MAP:
|
||||||
_setRestriction(subField)
|
_setRestriction(subField)
|
||||||
return True
|
return True
|
||||||
invalidChoiceExit(subField, SHAREDDRIVE_RESTRICTIONS_MAP, True)
|
invalidChoiceExit(subField, SHAREDDRIVE_RESTRICTIONS_MAP, True)
|
||||||
|
|||||||
Reference in New Issue
Block a user