mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 20:31:35 +00:00
Added the following options to <PermissionMatch> that allow more powerful matching.
Added the following options to `<PermissionMatch>` that allow more powerful matching. ``` nottype <DriveFileACLType> typelist <DriveFileACLTypeList> nottypelist <DriveFileACLTypeList> rolelist <DriveFileACLRoleList> notrolelist <DriveFileACLRoleList> ``` * See: https://github.com/taers232c/GAMADV-XTD3/wiki/Permission-Matches#define-a-match
This commit is contained in:
@@ -11,6 +11,46 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
|
|||||||
|
|
||||||
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
|
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
|
||||||
|
|
||||||
|
### 6.67.35
|
||||||
|
|
||||||
|
Added the following options to `<PermissionMatch>` that allow more powerful matching.
|
||||||
|
```
|
||||||
|
nottype <DriveFileACLType>
|
||||||
|
typelist <DriveFileACLTypeList>
|
||||||
|
nottypelist <DriveFileACLTypeList>
|
||||||
|
rolelist <DriveFileACLRoleList>
|
||||||
|
notrolelist <DriveFileACLRoleList>
|
||||||
|
```
|
||||||
|
* See: https://github.com/taers232c/GAMADV-XTD3/wiki/Permission-Matches#define-a-match
|
||||||
|
|
||||||
|
### 6.67.34
|
||||||
|
|
||||||
|
Added option `movetoorgunitdelay <Integer>` to `gam <UserTypeEntity> create shareddrive <Name> ... ou|org|orgunit <OrgUnitItem>`.
|
||||||
|
GAM creates the Shared Drive, verifies that it has been created and then tries to move it to `<OrgUnitItem>`. Google seems to
|
||||||
|
require a delay or the following error is generated.
|
||||||
|
```
|
||||||
|
ERROR: 409: 409 - The operation was aborted.
|
||||||
|
```
|
||||||
|
`movetoorgunitdelay` defaults to 20 seconds which seems to work; `<Integer>` can range from 0 to 60.
|
||||||
|
|
||||||
|
### 6.67.33
|
||||||
|
|
||||||
|
Upgraded to OpenSSL 3.2.1 where possible.
|
||||||
|
|
||||||
|
Fixed bug in `gam <UserTypeEntity> print shareddrives` where `role` was improperly displayed as `fileOrganizer`
|
||||||
|
rather than `writer`.
|
||||||
|
|
||||||
|
Added option `guiroles [<Boolean>]` to `gam <UserTypeEntity> info|print|show shareddrive` that maps
|
||||||
|
the Drive API role names to the Google Drive GUI role names.
|
||||||
|
```
|
||||||
|
API: GUI
|
||||||
|
commenter: Commenter
|
||||||
|
fileOrganizer: Content manager
|
||||||
|
organizer: Manager
|
||||||
|
reader: Viewer
|
||||||
|
writer: Contributor
|
||||||
|
```
|
||||||
|
|
||||||
### 6.67.32
|
### 6.67.32
|
||||||
|
|
||||||
Updated `<ToDriveAttribute>` to allow multiple `tdshare <EmailAddress> commenter|reader|writer` options.
|
Updated `<ToDriveAttribute>` to allow multiple `tdshare <EmailAddress> commenter|reader|writer` options.
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ writes the credentials into the file oauth2.txt.
|
|||||||
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
||||||
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
|
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
|
||||||
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
||||||
GAMADV-XTD3 6.67.32 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.67.35 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.1 64-bit final
|
Python 3.12.1 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
@@ -1002,7 +1002,7 @@ writes the credentials into the file oauth2.txt.
|
|||||||
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
|
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
|
||||||
C:\GAMADV-XTD3>gam version
|
C:\GAMADV-XTD3>gam version
|
||||||
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
|
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
|
||||||
GAMADV-XTD3 6.67.32 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.67.35 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.1 64-bit final
|
Python 3.12.1 64-bit final
|
||||||
Windows-10-10.0.17134 AMD64
|
Windows-10-10.0.17134 AMD64
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
<DeviceUserList> ::= "<DeviceUserID>(,<DeviceUserID>)*"
|
<DeviceUserList> ::= "<DeviceUserID>(,<DeviceUserID>)*"
|
||||||
<DomainNameList> ::= "<DomainName>(,<DomainName>)*"
|
<DomainNameList> ::= "<DomainName>(,<DomainName>)*"
|
||||||
<DriveFileACLRoleList> ::= "<DriveFileACLRole>(,<DriveFileACLRole>)*"
|
<DriveFileACLRoleList> ::= "<DriveFileACLRole>(,<DriveFileACLRole>)*"
|
||||||
|
<DriveFileACLTypeList> ::= "<DriveFileACLType>(,<DriveFileACLType>)*"
|
||||||
<DriveFileList> ::= "<DriveFileItem>(,<DriveFileItem>)*"
|
<DriveFileList> ::= "<DriveFileItem>(,<DriveFileItem>)*"
|
||||||
<DriveFilePermissionList> ::= "<DriveFilePermission>(,<DriveFilePermission>)*"
|
<DriveFilePermissionList> ::= "<DriveFilePermission>(,<DriveFilePermission>)*"
|
||||||
<DriveFilePermissionIDList> ::= "<DriveFilePermissionID>(,<DriveFilePermissionID>)*"
|
<DriveFilePermissionIDList> ::= "<DriveFilePermissionID>(,<DriveFilePermissionID>)*"
|
||||||
|
|||||||
@@ -18,7 +18,10 @@
|
|||||||
contributor|editor|writer|
|
contributor|editor|writer|
|
||||||
manager|organizer|owner|
|
manager|organizer|owner|
|
||||||
reader|viewer
|
reader|viewer
|
||||||
|
<DriveFileACLRoleList> ::= "<DriveFileACLRole>(,<DriveFileACLRole>)*"
|
||||||
|
|
||||||
<DriveFileACLType> ::= anyone|domain|group|user
|
<DriveFileACLType> ::= anyone|domain|group|user
|
||||||
|
<DriveFileACLTypeList> ::= "<DriveFileACLType>(,<DriveFileACLType>)*"
|
||||||
|
|
||||||
<EmailAddress> ::= <String>@<DomainName>
|
<EmailAddress> ::= <String>@<DomainName>
|
||||||
<EmailAddressList> ::= "<EmailAddress>(,<EmailAddress>)*"
|
<EmailAddressList> ::= "<EmailAddress>(,<EmailAddress>)*"
|
||||||
@@ -31,7 +34,8 @@
|
|||||||
|
|
||||||
<PermissionMatch> ::=
|
<PermissionMatch> ::=
|
||||||
pm|permissionmatch [not]
|
pm|permissionmatch [not]
|
||||||
[type <DriveFileACLType>] [role|notrole <DriveFileACLRole>]
|
[type|nottype <DriveFileACLType>] [role|notrole <DriveFileACLRole>]
|
||||||
|
[typelist|nottypelist <DriveFileACLTypeList>] [rolelist|notrolelist <DriveFileACLRoleList>]
|
||||||
[allowfilediscovery|withlink <Boolean>]
|
[allowfilediscovery|withlink <Boolean>]
|
||||||
[emailaddress <RegularExpression>] [emailaddressList <EmailAddressList>]
|
[emailaddress <RegularExpression>] [emailaddressList <EmailAddressList>]
|
||||||
[permissionidlist <PermissionIDList>
|
[permissionidlist <PermissionIDList>
|
||||||
@@ -72,9 +76,14 @@ In the `print/show drivefileacls` and `create/delete permissions` commands you c
|
|||||||
## Define a Match
|
## Define a Match
|
||||||
* `pm|permissionmatch` - Start of permission match definition.
|
* `pm|permissionmatch` - Start of permission match definition.
|
||||||
* `not` - Negate the match.
|
* `not` - Negate the match.
|
||||||
* `type <DriveFileACLType>` - The type of the grantee.
|
* `type <DriveFileACLType>` - The type of the grantee must match.
|
||||||
* `role <DriveFileACLRole>` - The role granted by this permission.
|
* `nottype <DriveFileACLType>` - The type of the grantee must not match.
|
||||||
* `notrole <DriveFileACLRole>` - The role granted by this permission.
|
* `typelist <DriveFileACLTypeList>` - The type of the grantee must match any value in the list.
|
||||||
|
* `nottypelist <DriveFileACLTypeList>` - The type of the grantee must not match any value in the list.
|
||||||
|
* `role <DriveFileACLRole>` - The role granted by this permission must match.
|
||||||
|
* `notrole <DriveFileACLRole>` - The role granted by this permission must not match.
|
||||||
|
* `rolelist <DriveFileACLRoleList>` - The role granted by this permission must match any value in the list..
|
||||||
|
* `notrolelist <DriveFileACLRoleList>` - The role granted by this permission must not match any value in the list..
|
||||||
* `allowfilediscovery|withlink <Boolean>` - Whether a link is required or whether the file can be discovered through search.
|
* `allowfilediscovery|withlink <Boolean>` - Whether a link is required or whether the file can be discovered through search.
|
||||||
* `emailaddress <RegularExpression>` - For types user and group, the required email address.
|
* `emailaddress <RegularExpression>` - For types user and group, the required email address.
|
||||||
* `emailaddresslist <EmailAddressList>` - For types user and group, a list of required email addresses; any one of which must match.
|
* `emailaddresslist <EmailAddressList>` - For types user and group, a list of required email addresses; any one of which must match.
|
||||||
|
|||||||
@@ -277,12 +277,15 @@ gam <UserTypeEntity> unhide teamdrive <SharedDriveEntity>
|
|||||||
```
|
```
|
||||||
gam <UserTypeEntity> show teamdriveinfo <SharedDriveEntity>
|
gam <UserTypeEntity> show teamdriveinfo <SharedDriveEntity>
|
||||||
gam <UserTypeEntity> info teamdrive <SharedDriveEntity>
|
gam <UserTypeEntity> info teamdrive <SharedDriveEntity>
|
||||||
[fields <SharedDriveFieldNameList>] [formatjson]
|
[fields <SharedDriveFieldNameList>]
|
||||||
|
[guiroles [<Boolean>] [formatjson]
|
||||||
gam <UserTypeEntity> show teamdriveinfo <SharedDriveEntity>
|
gam <UserTypeEntity> show teamdriveinfo <SharedDriveEntity>
|
||||||
[fields <SharedDriveFieldNameList>] [formatjson]
|
[fields <SharedDriveFieldNameList>]
|
||||||
|
[guiroles [<Boolean>] [formatjson]
|
||||||
gam <UserTypeEntity> show teamdrives
|
gam <UserTypeEntity> show teamdrives
|
||||||
[matchname <RegularExpression>] (role|roles <SharedDriveACLRoleList>)*
|
[matchname <RegularExpression>] (role|roles <SharedDriveACLRoleList>)*
|
||||||
[fields <SharedDriveFieldNameList>] [formatjson]
|
[fields <SharedDriveFieldNameList>]
|
||||||
|
[guiroles [<Boolean>] [formatjson]
|
||||||
```
|
```
|
||||||
By default, Gam displays all Teams Drives accessible by the user.
|
By default, Gam displays all Teams Drives accessible by the user.
|
||||||
* `matchname <RegularExpression>` - Display Shared Drives with names that match a pattern.
|
* `matchname <RegularExpression>` - Display Shared Drives with names that match a pattern.
|
||||||
@@ -301,10 +304,20 @@ By default, Gam displays all Teams Drives accessible by the user.
|
|||||||
|
|
||||||
The Google Drive API does not list roles for Shared Drives so GAM generates a role from the capabilities:
|
The Google Drive API does not list roles for Shared Drives so GAM generates a role from the capabilities:
|
||||||
* `commenter - canComment: True, canEdit: False`
|
* `commenter - canComment: True, canEdit: False`
|
||||||
* `fileOrganizer - canAddChildren: True, canManageMembers: False`
|
* `reader - canComment: False, canEdit: False`
|
||||||
|
* `writer - canEdit: True, canTrashChildren: False`
|
||||||
|
* `fileOrganizer - canTrashChildren: True, canManageMembers: False`
|
||||||
* `organizer - canManageMembers: True`
|
* `organizer - canManageMembers: True`
|
||||||
* `reader - canCopy': True, canComment: False`
|
|
||||||
* `writer - canEdit: True, canManageMembers: False`
|
By default, the Drive API role names are displayed, use `guiroles` to display the Google Drive GUI role names.
|
||||||
|
```
|
||||||
|
API: GUI
|
||||||
|
commenter: Commenter
|
||||||
|
fileOrganizer: Content manager
|
||||||
|
organizer: Manager
|
||||||
|
reader: Viewer
|
||||||
|
writer: Contributor
|
||||||
|
```
|
||||||
|
|
||||||
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format,
|
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format,
|
||||||
* `formatjson` - Display the fields in JSON format.
|
* `formatjson` - Display the fields in JSON format.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
Print the current version of Gam with details
|
Print the current version of Gam with details
|
||||||
```
|
```
|
||||||
gam version
|
gam version
|
||||||
GAMADV-XTD3 6.67.32 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.67.35 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.1 64-bit final
|
Python 3.12.1 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
@@ -16,7 +16,7 @@ Time: 2023-06-02T21:10:00-07:00
|
|||||||
Print the current version of Gam with details and time offset information
|
Print the current version of Gam with details and time offset information
|
||||||
```
|
```
|
||||||
gam version timeoffset
|
gam version timeoffset
|
||||||
GAMADV-XTD3 6.67.32 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.67.35 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.1 64-bit final
|
Python 3.12.1 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
@@ -28,7 +28,7 @@ Your system time differs from www.googleapis.com by less than 1 second
|
|||||||
Print the current version of Gam with extended details and SSL information
|
Print the current version of Gam with extended details and SSL information
|
||||||
```
|
```
|
||||||
gam version extended
|
gam version extended
|
||||||
GAMADV-XTD3 6.67.32 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.67.35 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.1 64-bit final
|
Python 3.12.1 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
@@ -65,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64
|
|||||||
Path: /Users/Admin/bin/gamadv-xtd3
|
Path: /Users/Admin/bin/gamadv-xtd3
|
||||||
Version Check:
|
Version Check:
|
||||||
Current: 5.35.08
|
Current: 5.35.08
|
||||||
Latest: 6.67.32
|
Latest: 6.67.35
|
||||||
echo $?
|
echo $?
|
||||||
1
|
1
|
||||||
```
|
```
|
||||||
@@ -73,7 +73,7 @@ echo $?
|
|||||||
Print the current version number without details
|
Print the current version number without details
|
||||||
```
|
```
|
||||||
gam version simple
|
gam version simple
|
||||||
6.67.32
|
6.67.35
|
||||||
```
|
```
|
||||||
In Linux/MacOS you can do:
|
In Linux/MacOS you can do:
|
||||||
```
|
```
|
||||||
@@ -83,7 +83,7 @@ echo $VER
|
|||||||
Print the current version of Gam and address of this Wiki
|
Print the current version of Gam and address of this Wiki
|
||||||
```
|
```
|
||||||
gam help
|
gam help
|
||||||
GAM 6.67.32 - https://github.com/taers232c/GAMADV-XTD3
|
GAM 6.67.35 - https://github.com/taers232c/GAMADV-XTD3
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.1 64-bit final
|
Python 3.12.1 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
|
|||||||
@@ -664,6 +664,7 @@ If an item contains spaces, it should be surrounded by ".
|
|||||||
<DeviceUserList> ::= "<DeviceUserID>(,<DeviceUserID>)*"
|
<DeviceUserList> ::= "<DeviceUserID>(,<DeviceUserID>)*"
|
||||||
<DomainNameList> ::= "<DomainName>(,<DomainName>)*"
|
<DomainNameList> ::= "<DomainName>(,<DomainName>)*"
|
||||||
<DriveFileACLRoleList> ::= "<DriveFileACLRole>(,<DriveFileACLRole>)*"
|
<DriveFileACLRoleList> ::= "<DriveFileACLRole>(,<DriveFileACLRole>)*"
|
||||||
|
<DriveFileACLTypeList> ::= "<DriveFileACLType>(,<DriveFileACLType>)*"
|
||||||
<DriveFileList> ::= "<DriveFileItem>(,<DriveFileItem>)*"
|
<DriveFileList> ::= "<DriveFileItem>(,<DriveFileItem>)*"
|
||||||
<DriveFilePermissionList> ::= "<DriveFilePermission>(,<DriveFilePermission>)*"
|
<DriveFilePermissionList> ::= "<DriveFilePermission>(,<DriveFilePermission>)*"
|
||||||
<DriveFilePermissionIDList> ::= "<DriveFilePermissionID>(,<DriveFilePermissionID>)*"
|
<DriveFilePermissionIDList> ::= "<DriveFilePermissionID>(,<DriveFilePermissionID>)*"
|
||||||
@@ -4635,6 +4636,23 @@ gam <UserTypeEntity> show shareddrives
|
|||||||
[fields <SharedDriveFieldNameList>]
|
[fields <SharedDriveFieldNameList>]
|
||||||
[guiroles [<Boolean>]] [formatjson]
|
[guiroles [<Boolean>]] [formatjson]
|
||||||
|
|
||||||
|
<PermissionMatch> ::=
|
||||||
|
pm|permissionmatch [not]
|
||||||
|
[type|nottype <DriveFileACLType>] [role|notrole <DriveFileACLRole>]
|
||||||
|
[typelist|nottypelist <DriveFileACLTypeList>] [rolelist|notrolelist <DriveFileACLRoleList>]
|
||||||
|
[allowfilediscovery|withlink <Boolean>]
|
||||||
|
[emailaddress <RegularExpression>] [emailaddressList <EmailAddressList>]
|
||||||
|
[permissionidlist <PermissionIDList>
|
||||||
|
[name|displayname <String>]
|
||||||
|
[domain|notdomain <RegularExpression>] [domainlist|notdomainlist <DomainNameList>]
|
||||||
|
[expirationstart <Time>] [expirationend <Time>]
|
||||||
|
[deleted <Boolean>] [inherited <Boolean>]
|
||||||
|
em|endmatch
|
||||||
|
<PermissionMatchMode> ::=
|
||||||
|
pmm|permissionmatchmode or|and
|
||||||
|
<PermissionMatchAction> ::=
|
||||||
|
pma|permissionmatchaction process|skip
|
||||||
|
|
||||||
These commands are used to manage the ACLs on the Team Drives themselves, not the files/folders on the Team Drives.
|
These commands are used to manage the ACLs on the Team Drives themselves, not the files/folders on the Team Drives.
|
||||||
|
|
||||||
<DrivePermissionsFieldName> ::=
|
<DrivePermissionsFieldName> ::=
|
||||||
@@ -5810,7 +5828,6 @@ gam <UserTypeEntity> create focustime
|
|||||||
[declinemessage <String>]
|
[declinemessage <String>]
|
||||||
[summary <String>]
|
[summary <String>]
|
||||||
(timerange <Time> <Time> [recurrence <String>])+
|
(timerange <Time> <Time> [recurrence <String>])+
|
||||||
[timezone <String>]
|
|
||||||
|
|
||||||
gam <UserTypeEntity> create outofoffice
|
gam <UserTypeEntity> create outofoffice
|
||||||
[declinemode none|all|new]
|
[declinemode none|all|new]
|
||||||
@@ -6587,19 +6604,6 @@ gam <UserTypeEntity> collect orphans
|
|||||||
writerscanshare
|
writerscanshare
|
||||||
<DriveFieldNameList> ::= "<DriveFieldName>(,<DriveFieldName>)*"
|
<DriveFieldNameList> ::= "<DriveFieldName>(,<DriveFieldName>)*"
|
||||||
|
|
||||||
<PermissionMatch> ::=
|
|
||||||
permissionmatch|pm [not]
|
|
||||||
[type anyone|user|group|domain] [role|notrole <DriveFileACLRole>] [allowfilediscovery|withlink <Boolean>]
|
|
||||||
[emailaddress <RegularExpression>] [name|displayname <String>]
|
|
||||||
[domain|notdomain <RegularExpression>] [domainlist|notdomainlist <DomainNameList>]
|
|
||||||
[expirationstart <Time>] [expirationend <Time>]
|
|
||||||
[deleted <Boolean>] [inherited <Boolean>]
|
|
||||||
endmatch|em
|
|
||||||
<PermissionMatchMode> ::=
|
|
||||||
permissionmatchmode|pmm or|and
|
|
||||||
<PermissionMatchAction> ::=
|
|
||||||
permissionmatchaction|pma process|skip
|
|
||||||
|
|
||||||
gam <UserTypeEntity> show fileinfo <DriveFileEntity>
|
gam <UserTypeEntity> show fileinfo <DriveFileEntity>
|
||||||
[returnidonly]
|
[returnidonly]
|
||||||
[filepath|fullpath] [pathdelimiter <Character>]
|
[filepath|fullpath] [pathdelimiter <Character>]
|
||||||
|
|||||||
@@ -2,6 +2,18 @@
|
|||||||
|
|
||||||
Merged GAM-Team version
|
Merged GAM-Team version
|
||||||
|
|
||||||
|
6.67.35
|
||||||
|
|
||||||
|
Added the following options to `<PermissionMatch>` that allow more powerful matching.
|
||||||
|
```
|
||||||
|
nottype <DriveFileACLType>
|
||||||
|
typelist <DriveFileACLTypeList>
|
||||||
|
nottypelist <DriveFileACLTypeList>
|
||||||
|
rolelist <DriveFileACLRoleList>
|
||||||
|
notrolelist <DriveFileACLRoleList>
|
||||||
|
```
|
||||||
|
* See: https://github.com/taers232c/GAMADV-XTD3/wiki/Permission-Matches#define-a-match
|
||||||
|
|
||||||
6.67.34
|
6.67.34
|
||||||
|
|
||||||
Added option `movetoorgunitdelay <Integer>` to `gam <UserTypeEntity> create shareddrive <Name> ... ou|org|orgunit <OrgUnitItem>`.
|
Added option `movetoorgunitdelay <Integer>` to `gam <UserTypeEntity> create shareddrive <Name> ... ou|org|orgunit <OrgUnitItem>`.
|
||||||
|
|||||||
@@ -52518,16 +52518,31 @@ class PermissionMatch():
|
|||||||
body = {}
|
body = {}
|
||||||
while Cmd.ArgumentsRemaining():
|
while Cmd.ArgumentsRemaining():
|
||||||
myarg = getArgument()
|
myarg = getArgument()
|
||||||
if myarg == 'type':
|
if myarg in {'type', 'nottype'}:
|
||||||
body['type'] = getChoice(DRIVEFILE_ACL_PERMISSION_TYPES)
|
body[myarg] = set(getChoice(DRIVEFILE_ACL_PERMISSION_TYPES))
|
||||||
self.permissionFields.add('type')
|
self.permissionFields.add('type')
|
||||||
elif myarg == 'role':
|
elif myarg in {'typelist', 'nottypelist'}:
|
||||||
|
arg = 'type' if myarg == 'typelist' else 'nottype'
|
||||||
|
body[arg] = set()
|
||||||
|
for ptype in getString(Cmd.OB_PERMISSION_TYPE_LIST).lower().replace(',', ' ').split():
|
||||||
|
if ptype in DRIVEFILE_ACL_PERMISSION_TYPES:
|
||||||
|
body[arg].add(ptype)
|
||||||
|
else:
|
||||||
|
invalidChoiceExit(ptype, DRIVEFILE_ACL_PERMISSION_TYPES, True)
|
||||||
|
self.permissionFields.add('type')
|
||||||
|
elif myarg in {'role', 'notrole'}:
|
||||||
roleLocation = Cmd.Location()
|
roleLocation = Cmd.Location()
|
||||||
body['role'] = getChoice(DRIVEFILE_ACL_ROLES_MAP, mapChoice=True)
|
body[myarg] = set(getChoice(DRIVEFILE_ACL_ROLES_MAP, mapChoice=True))
|
||||||
self.permissionFields.add('role')
|
self.permissionFields.add('role')
|
||||||
elif myarg == 'notrole':
|
elif myarg in {'rolelist', 'notrolelist'}:
|
||||||
|
arg = 'role' if myarg == 'rolelist' else 'notrole'
|
||||||
|
body[arg] = set()
|
||||||
roleLocation = Cmd.Location()
|
roleLocation = Cmd.Location()
|
||||||
body['notrole'] = getChoice(DRIVEFILE_ACL_ROLES_MAP, mapChoice=True)
|
for prole in getString(Cmd.OB_PERMISSION_ROLE_LIST).lower().replace(',', ' ').split():
|
||||||
|
if prole in DRIVEFILE_ACL_ROLES_MAP:
|
||||||
|
body[arg].add(DRIVEFILE_ACL_ROLES_MAP[prole])
|
||||||
|
else:
|
||||||
|
invalidChoiceExit(prole, DRIVEFILE_ACL_ROLES_MAP, True)
|
||||||
self.permissionFields.add('role')
|
self.permissionFields.add('role')
|
||||||
elif myarg == 'emailaddress':
|
elif myarg == 'emailaddress':
|
||||||
body['emailAddress'] = getREPattern(re.IGNORECASE)
|
body['emailAddress'] = getREPattern(re.IGNORECASE)
|
||||||
@@ -52610,10 +52625,13 @@ class PermissionMatch():
|
|||||||
match = False
|
match = False
|
||||||
for field, value in iter(permissionMatch[1].items()):
|
for field, value in iter(permissionMatch[1].items()):
|
||||||
if field in {'type', 'role'}:
|
if field in {'type', 'role'}:
|
||||||
if value != permission.get(field, ''):
|
if permission.get(field, '') not in value:
|
||||||
|
break
|
||||||
|
elif field in {'nottype'}:
|
||||||
|
if permission.get('type', '') in value:
|
||||||
break
|
break
|
||||||
elif field in {'notrole'}:
|
elif field in {'notrole'}:
|
||||||
if value == permission.get('role', ''):
|
if permission.get('role', '') in value:
|
||||||
break
|
break
|
||||||
elif field in {'allowFileDiscovery', 'deleted'}:
|
elif field in {'allowFileDiscovery', 'deleted'}:
|
||||||
if value != permission.get(field, False):
|
if value != permission.get(field, False):
|
||||||
@@ -58437,7 +58455,7 @@ def transferDrive(users):
|
|||||||
if addTargetParent or removeTargetParents:
|
if addTargetParent or removeTargetParents:
|
||||||
op = 'Add/Remove Target Parents'
|
op = 'Add/Remove Target Parents'
|
||||||
callGAPI(targetDrive.files(), 'update',
|
callGAPI(targetDrive.files(), 'update',
|
||||||
throwReasons=GAPI.DRIVE_ACCESS_THROW_REASONS+[GAPI.INSUFFICIENT_PARENT_PERMISSIONS],
|
throwReasons=GAPI.DRIVE_ACCESS_THROW_REASONS+[GAPI.CANNOT_ADD_PARENT, GAPI.INSUFFICIENT_PARENT_PERMISSIONS],
|
||||||
retryReasons=[GAPI.BAD_REQUEST, GAPI.FILE_NOT_FOUND], triesLimit=3,
|
retryReasons=[GAPI.BAD_REQUEST, GAPI.FILE_NOT_FOUND], triesLimit=3,
|
||||||
fileId=childFileId,
|
fileId=childFileId,
|
||||||
addParents=addTargetParent, removeParents=','.join(removeTargetParents), fields='')
|
addParents=addTargetParent, removeParents=','.join(removeTargetParents), fields='')
|
||||||
@@ -58448,7 +58466,7 @@ def transferDrive(users):
|
|||||||
else:
|
else:
|
||||||
entityModifierNewValueItemValueListActionPerformed([Ent.USER, sourceUser, childFileType, childFileName], Act.MODIFIER_TO, None, [Ent.USER, targetUser], j, jcount)
|
entityModifierNewValueItemValueListActionPerformed([Ent.USER, sourceUser, childFileType, childFileName], Act.MODIFIER_TO, None, [Ent.USER, targetUser], j, jcount)
|
||||||
except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.unknownError,
|
except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.unknownError,
|
||||||
GAPI.badRequest, GAPI.sharingRateLimitExceeded, GAPI.insufficientParentPermissions) as e:
|
GAPI.badRequest, GAPI.sharingRateLimitExceeded, GAPI.cannotAddParent, GAPI.insufficientParentPermissions) as e:
|
||||||
entityActionFailedWarning([Ent.USER, actionUser, childFileType, childFileName], f'{op}: {str(e)}', j, jcount)
|
entityActionFailedWarning([Ent.USER, actionUser, childFileType, childFileName], f'{op}: {str(e)}', j, jcount)
|
||||||
except (GAPI.insufficientFilePermissions, GAPI.fileOwnerNotMemberOfWriterDomain, GAPI.crossDomainMoveRestriction) as e:
|
except (GAPI.insufficientFilePermissions, GAPI.fileOwnerNotMemberOfWriterDomain, GAPI.crossDomainMoveRestriction) as e:
|
||||||
if not createShortcutsForNonmovableFiles:
|
if not createShortcutsForNonmovableFiles:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright (C) 2023 Ross Scroggs All Rights Reserved.
|
# Copyright (C) 2024 Ross Scroggs All Rights Reserved.
|
||||||
#
|
#
|
||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright (C) 2023 Ross Scroggs All Rights Reserved.
|
# Copyright (C) 2024 Ross Scroggs All Rights Reserved.
|
||||||
#
|
#
|
||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
#
|
#
|
||||||
@@ -931,6 +931,8 @@ class GamCLArgs():
|
|||||||
OB_PARAMETER_VALUE = 'ParameterValue'
|
OB_PARAMETER_VALUE = 'ParameterValue'
|
||||||
OB_PASSWORD = 'Password'
|
OB_PASSWORD = 'Password'
|
||||||
OB_PERMISSION_ID_LIST = 'PermissionIDList'
|
OB_PERMISSION_ID_LIST = 'PermissionIDList'
|
||||||
|
OB_PERMISSION_ROLE_LIST = 'PermissionRoleList'
|
||||||
|
OB_PERMISSION_TYPE_LIST = 'PermissionTypeList'
|
||||||
OB_PHOTO_FILENAME_PATTERN = 'FilenameNamePattern'
|
OB_PHOTO_FILENAME_PATTERN = 'FilenameNamePattern'
|
||||||
OB_PRINTER_ID = 'PrinterID'
|
OB_PRINTER_ID = 'PrinterID'
|
||||||
OB_PRIVILEGE_LIST = 'PrivilegeList'
|
OB_PRIVILEGE_LIST = 'PrivilegeList'
|
||||||
|
|||||||
Reference in New Issue
Block a user