Differenze tra Drive condiviso e API Il mio Drive
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
I Drive condivisi seguono modelli di organizzazione, condivisione e proprietà diversi da
Il mio Drive. Pertanto, alcune operazioni di Il mio Drive
non sono consentite per i contenuti di un Drive condiviso.
Questa guida illustra le differenze specifiche delle API di Drive condivisi nelle risorse files
e
changes
.
Risorsa file
I seguenti campi della risorsa files
vengono compilati
solo per i file che si trovano in un Drive condiviso:
hasAugmentedPermissions
: indica se agli utenti è stato concesso l'accesso al file
direttamente su questo file.
capabilities/canAddFolderFromAnotherDrive
: indica se l'utente corrente può
aggiungere una cartella da un altro drive (un altro Drive condiviso o Il mio
Drive) a questa cartella.
capabilities/canDeleteChildren
: Indica se l'utente corrente può eliminare
i figli di questa cartella.
capabilities/canMoveChildrenOutOfDrive
: indica se l'utente attuale può spostare
i file secondari di questa cartella al di fuori del Drive condiviso.
capabilities/canMoveChildrenWithinDrive
: indica se l'utente corrente può spostare
i file secondari di questa cartella all'interno del Drive condiviso.
capabilities/canMoveItemWithinDrive
: indica se l'utente attuale può spostare
questo elemento del Drive condiviso all'interno del Drive condiviso.
capabilities/canReadDrive
: indica se l'utente corrente ha accesso in lettura al
Drive condiviso a cui appartiene questo file.
capabilities/canTrashChildren
: indica se l'utente corrente può spostare nel cestino i file secondari
di questa cartella.
driveId
: l'ID del Drive condiviso in cui si trova il file.
trashingUser
: se il file è stato eliminato in modo esplicito, l'utente che
lo ha eliminato.
trashedTime
: L'ora in cui l'elemento è stato cestinato. Se utilizzi la versione precedente
dell'API Drive v2, questo campo si chiama trashedDate
.
I seguenti campi non vengono compilati per i file che si trovano in un Drive condiviso:
permissions
: a causa delle dimensioni potenziali degli elenchi di controllo dell'accesso (ACL) dei Drive condivisi, le autorizzazioni non vengono restituite come parte dei file. Utilizza il metodo
permissions.list
, che supporta la paginazione, per elencare le autorizzazioni
per un file all'interno di un Drive condiviso o della cartella del Drive condiviso.
owners
, ownerNames
, ownedByMe
: i file all'interno di un Drive condiviso sono di proprietà
del Drive condiviso, non dei singoli utenti.
folderColorRgb
: non è possibile colorare le cartelle singolarmente.
shared
: Tutti gli elementi di un Drive condiviso vengono condivisi.
writersCanShare
: non è possibile limitare la condivisione in base al ruolo nei Drive condivisi.
I seguenti campi vengono impostati solo quando all'utente sono stati concessi i permessi di accesso ai file
su un elemento:
sharedWithMeDate
sharingUser
I seguenti campi richiedono una particolare attenzione quando vengono utilizzati con i drive condivisi:
parents.isRoot
: questo campo è vero solo per la cartella principale di Il mio Drive; è falso per la cartella di primo livello del Drive condiviso.
parents
: un genitore non viene visualizzato nell'elenco dei genitori se l'utente che ha effettuato la richiesta non è membro del Drive condiviso e non ha accesso al genitore. Inoltre, ad eccezione della cartella di primo livello, l'elenco dei genitori
deve contenere esattamente un elemento se il file si trova all'interno di un Drive
condiviso.
capabilities/canRemoveChildren
: utilizza capabilities/canDeleteChildren
o
capabilities/canTrashChildren
.
Modifica risorsa
Le seguenti nuove proprietà sono disponibili nella risorsa
changes
per un Drive condiviso:
changeType
: il tipo di modifica. I valori possibili sono file
e drive
.
driveId
: l'ID del Drive condiviso associato a questa modifica.
drive
: lo stato aggiornato del drive condiviso. Presente se changeType
è drive
e l'utente è ancora membro del Drive condiviso.
Potrebbero essere necessarie modifiche aggiuntive per le applicazioni che devono sincronizzare i contenuti
con i Drive condivisi o monitorare l'attività. Per maggiori dettagli, vedi Monitorare le modifiche per gli utenti
e i Drive condivisi.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-08-29 UTC.
[null,null,["Ultimo aggiornamento 2025-08-29 UTC."],[],[],null,["# Shared drive versus My Drive API differences\n\nShared drives follow different organization, sharing, and ownership models from\na My Drive. As such, some My Drive operations\naren't permitted for content in a shared drive.\n\nThis guide outlines shared drive-specific API differences in the `files` and\n`changes` resources.\n\nFile resource\n-------------\n\nThe following fields in the [`files`](/workspace/drive/api/reference/rest/v3/files) resource are\nonly populated for files located within a shared drive:\n\n- `hasAugmentedPermissions`: Whether any users are granted file access directly on this file.\n- `capabilities/canAddFolderFromAnotherDrive`: Whether the current user can add a folder from another drive (a different shared drive or My Drive) to this folder.\n- `capabilities/canDeleteChildren`: Whether the current user can delete children of this folder.\n- `capabilities/canMoveChildrenOutOfDrive`: Whether the current user can move children of this folder outside of the shared drive.\n- `capabilities/canMoveChildrenWithinDrive`: Whether the current user can move children of this folder within the shared drive.\n- `capabilities/canMoveItemWithinDrive`: Whether the current user can move this shared drive item within the shared drive.\n- `capabilities/canReadDrive`: Whether the current user has read access to the shared drive to which this file belongs.\n- `capabilities/canTrashChildren`: Whether the current user can trash children of this folder.\n- `driveId`: The ID of the shared drive where the file is located.\n- `trashingUser`: If the file has been explicitly trashed, the user who trashed it.\n- `trashedTime`: The time that the item was trashed. If you're using the older Drive API v2, this field is called `trashedDate`.\n\nThe following fields aren't populated for files located within a shared drive:\n\n- `permissions`: Due to the potential size of shared drive access control lists (ACLs), permissions aren't returned as part of files. Use the `permissions.list` method, which supports pagination, to list permissions for a file within a shared drive or the shared drive folder.\n- `owners`, `ownerNames`, `ownedByMe`: Files within a shared drive are owned by the shared drive, not individual users.\n- `folderColorRgb`: Folders cannot be colored individually.\n- `shared`: All items in a shared drive are shared.\n- `writersCanShare`: It's not possible to restrict sharing by role in shared drives.\n\nThe following fields are only set when the user has been granted file access\npermissions on an item:\n\n- `sharedWithMeDate`\n- `sharingUser`\n\nThe following fields require special consideration when you use them with shared\ndrives:\n\n- `parents.isRoot`: This field is only true for the My Drive root folder; it's false for the shared drive top-level folder.\n- `parents`: A parent doesn't appear in the parents list if the requesting\n user isn't a member of the shared drive and doesn't have access to the\n parent. In addition, with the exception of the top level folder, the parents\n list must contain exactly one item if the file is located within a shared\n drive.\n\n | **Note:** If you're using the older Drive API v2:\n | - `shareable`: Deprecated. Use `capabilities/canShare`.\n | - `editable`: Deprecated. Use `capabilities/canEdit`.\n | - `copyable`: Deprecated. Use `capabilities/canCopy`.\n | - `canComment`: Deprecated. Use `capabilities/canComment`.\n | - `canReadRevisions`: Deprecated. Use `capabilities/canReadRevisions`.\n- `capabilities/canRemoveChildren`: Use `capabilities/canDeleteChildren` or\n `capabilities/canTrashChildren`.\n\nChange resource\n---------------\n\nThe following new fields are available in the\n[`changes`](/workspace/drive/api/reference/rest/v3/changes) resource for a shared drive:\n\n- `changeType`: The change type. Possible values are `file` and `drive`.\n- `driveId`: The ID of the shared drive associated with this change.\n- `drive`: The updated state of the shared drive. Present if the `changeType` is `drive` and the user is still a member of the shared drive.\n\nAdditional changes might be required for applications that need to sync content\nwith shared drives or track activity. For details, see [Track changes for users\nand shared drives](/workspace/drive/api/guides/about-changes).\n\nRelated topics\n--------------\n\n- [Files and folders overview](/workspace/drive/api/guides/about-files)\n- [Changes and revisions overview](/workspace/drive/api/guides/change-overview)"]]