Method: permissions.update
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
अनुमति अपडेट करता है.
चेतावनी: एक ही फ़ाइल पर, अनुमतियों के लिए एक साथ कई कार्रवाइयां नहीं की जा सकतीं. सिर्फ़ आखिरी अपडेट लागू किया जाता है.
एचटीटीपी अनुरोध
PUT https://www.googleapis.com/drive/v2/files/{fileId}/permissions/{permissionId}
यूआरएल में gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल किया गया है.
पाथ पैरामीटर
पैरामीटर |
fileId |
string
फ़ाइल या शेयर की गई ड्राइव का आईडी.
|
permissionId |
string
अनुमति का आईडी.
|
क्वेरी पैरामीटर
पैरामीटर |
removeExpiration |
boolean
ऐक्सेस की समयसीमा खत्म होने की तारीख हटानी है या नहीं.
|
supportsAllDrives |
boolean
अनुरोध करने वाला ऐप्लिकेशन, 'मेरी ड्राइव' और शेयर की गई ड्राइव, दोनों के साथ काम करता है या नहीं.
|
supportsTeamDrives (deprecated) |
boolean
इस्तेमाल नहीं किया जा सकता: इसके बजाय, supportsAllDrives का इस्तेमाल करें.
|
transferOwnership |
boolean
किसी भूमिका को owner में बदलने पर, क्या मौजूदा मालिकों की भूमिका लेखक में बदल जाती है. अगर भूमिका owner नहीं है, तो कुछ नहीं होता.
|
useDomainAdminAccess |
boolean
डोमेन एडमिन के तौर पर अनुरोध करें. अगर इस पैरामीटर को 'सही' पर सेट किया जाता है, तो अनुरोध करने वाले व्यक्ति को ऐक्सेस दिया जाएगा. हालांकि, इसके लिए ज़रूरी है कि फ़ाइल आईडी पैरामीटर, शेयर की गई ड्राइव का रेफ़रंस देता हो और अनुरोध करने वाला व्यक्ति उस डोमेन का एडमिन हो जिससे शेयर की गई ड्राइव जुड़ी है.
|
enforceExpansiveAccess |
boolean
अनुरोध में, ऐक्सेस के बड़े नियमों को लागू करना है या नहीं.
|
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में Permission
का उदाहरण है.
जवाब का मुख्य भाग
कामयाब रहने पर, जवाब के मुख्य हिस्से में Permission
का एक इंस्टेंस शामिल किया जाता है.
अनुमति के दायरे
इसके लिए, OAuth के इनमें से किसी एक स्कोप की ज़रूरत होती है:
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
कुछ स्कोप पर पाबंदी होती है. साथ ही, इनका इस्तेमाल करने के लिए आपके ऐप्लिकेशन को सुरक्षा से जुड़ी समीक्षा कराने की ज़रूरत होती है. ज़्यादा जानकारी के लिए, अनुमति से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[],[],null,["# Method: permissions.update\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nUpdates a permission.\n\n**Warning:** Concurrent permissions operations on the same file are not supported; only the last update is applied.\n\n### HTTP request\n\n`PUT https://www.googleapis.com/drive/v2/files/{fileId}/permissions/{permissionId}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------------|-----------------------------------------------|\n| `fileId` | `string` The ID for the file or shared drive. |\n| `permissionId` | `string` The ID for the permission. |\n\n### Query parameters\n\n| Parameters ||\n|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `removeExpiration` | `boolean` Whether to remove the expiration date. |\n| `supportsAllDrives` | `boolean` Whether the requesting application supports both My Drives and shared drives. |\n| `supportsTeamDrives` **(deprecated)** | `boolean` Deprecated: Use `supportsAllDrives` instead. |\n| `transferOwnership` | `boolean` Whether changing a role to `owner` downgrades the current owners to writers. Does nothing if the specified role is not `owner`. |\n| `useDomainAdminAccess` | `boolean` Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. |\n| `enforceExpansiveAccess` | `boolean` Whether the request should enforce expansive access rules. |\n\n### Request body\n\nThe request body contains an instance of [Permission](/workspace/drive/api/reference/rest/v2/permissions#Permission).\n\n### Response body\n\nIf successful, the response body contains an instance of [Permission](/workspace/drive/api/reference/rest/v2/permissions#Permission).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/docs`\n- `\n https://www.googleapis.com/auth/drive`\n- `\n https://www.googleapis.com/auth/drive.file`\n\nSome scopes are restricted and require a security assessment for your app to use them. For more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]