הבדלים בין האחסון השיתופי לבין ממשק ה-API של 'האחסון שלי'
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
האחסון השיתופי פועל לפי מודלים שונים של ארגון, שיתוף ובעלות בהשוואה לתיקייה 'האחסון שלי'. לכן, חלק מהפעולות בתיקייה 'האחסון שלי' לא מותרות לתוכן שנמצא באחסון השיתופי.
במדריך הזה מפורטים ההבדלים בין ממשקי ה-API של משאבי files
ו-changes
באחסון השיתופי.
משאב קובץ
השדות הבאים במשאב files
מאוכלסים רק עבור קבצים שנמצאים באחסון שיתופי:
-
hasAugmentedPermissions
: האם למשתמשים כלשהם ניתנת גישה לקובץ ישירות בקובץ הזה.
-
capabilities/canAddFolderFromAnotherDrive
: האם המשתמש הנוכחי יכול להוסיף לתיקייה הזו תיקייה מכונן אחר (אחסון שיתופי אחר או 'האחסון שלי').
-
capabilities/canDeleteChildren
: האם המשתמש הנוכחי יכול למחוק פריטים בתיקייה הזו.
-
capabilities/canMoveChildrenOutOfDrive
: האם המשתמש הנוכחי יכול להעביר צאצאים של התיקייה הזו מחוץ לאחסון השיתופי.
-
capabilities/canMoveChildrenWithinDrive
: האם המשתמש הנוכחי יכול להעביר פריטים בתיקייה הזו בתוך האחסון השיתופי.
-
capabilities/canMoveItemWithinDrive
: האם המשתמש הנוכחי יכול להעביר את הפריט הזה באחסון השיתופי בתוך האחסון השיתופי.
-
capabilities/canReadDrive
: האם למשתמש הנוכחי יש גישת קריאה לתיקייה המשותפת שהקובץ הזה שייך לה.
-
capabilities/canTrashChildren
: האם המשתמש הנוכחי יכול להעביר לאשפה פריטים שהם צאצאים של התיקייה הזו.
-
driveId
: המזהה של האחסון השיתופי שבו נמצא הקובץ.
-
trashingUser
: אם הקובץ הועבר במפורש לאשפה, המשתמש שהעביר אותו לאשפה.
-
trashedTime
: השעה שבה הפריט הועבר לאשפה. אם אתם משתמשים בגרסה ישנה יותר של Drive API (v2), השדה הזה נקרא trashedDate
.
השדות הבאים לא מאוכלסים עבור קבצים שנמצאים באחסון שיתופי:
-
permissions
: בגלל הגודל הפוטנציאלי של רשימות בקרת הגישה (ACL) של תיקיות אחסון שיתופי, ההרשאות לא מוחזרות כחלק מהקבצים. כדי להציג את ההרשאות של קובץ בתיקיית אחסון שיתופי או בתיקיית האחסון השיתופי, צריך להשתמש בשיטה permissions.list
שתומכת במספור עמודים.
-
owners
, ownerNames
ו-ownedByMe
: הבעלות על קבצים באחסון שיתופי היא של האחסון השיתופי, ולא של משתמשים ספציפיים.
folderColorRgb
: אי אפשר לצבוע תיקיות בנפרד.
-
shared
: כל הפריטים באחסון השיתופי משותפים.
-
writersCanShare
: אי אפשר להגביל את השיתוף לפי תפקיד בתיקיות משותפות.
השדות הבאים מוגדרים רק אם למשתמש ניתנו הרשאות גישה לקובץ בפריט:
sharedWithMeDate
sharingUser
כשמשתמשים בשדות הבאים עם כוננים משותפים, צריך לשים לב לנקודות הבאות:
-
parents.isRoot
: הערך בשדה הזה הוא true רק עבור תיקיית הבסיס של 'האחסון שלי'. הערך הוא false עבור התיקייה ברמה העליונה של האחסון השיתופי.
parents
: הורה לא מופיע ברשימת ההורים אם המשתמש ששולח את הבקשה לא חבר באחסון השיתופי ואין לו גישה להורה. בנוסף, אם הקובץ נמצא באחסון שיתופי, רשימת ההורים חייבת להכיל פריט אחד בלבד, למעט במקרה של תיקייה ברמה העליונה.
capabilities/canRemoveChildren
: משתמשים ב-capabilities/canDeleteChildren
או ב-capabilities/canTrashChildren
.
שינוי המשאב
השדות החדשים הבאים זמינים במשאב changes
של אחסון שיתופי:
changeType
: סוג השינוי. הערכים האפשריים הם file
ו-drive
.
-
driveId
: המזהה של האחסון השיתופי שמשויך לשינוי הזה.
-
drive
: המצב המעודכן של האחסון השיתופי. הערך הזה מופיע אם changeType
הוא drive
והמשתמש עדיין חבר באחסון השיתופי.
יכול להיות שיידרשו שינויים נוספים באפליקציות שצריכות לסנכרן תוכן עם תיקיות אחסון שיתופי או לעקוב אחרי פעילות. פרטים נוספים זמינים במאמר בנושא מעקב אחרי שינויים אצל משתמשים ובתיקיות אחסון שיתופי.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-29 (שעון UTC).
[null,null,["עדכון אחרון: 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)"]]