Method: permissions.create
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह फ़ाइल या शेयर की गई ड्राइव के लिए अनुमति बनाता है.
चेतावनी: एक ही फ़ाइल पर अनुमतियों से जुड़ी एक साथ कई कार्रवाइयां नहीं की जा सकतीं. सिर्फ़ आखिरी अपडेट लागू होता है.
एचटीटीपी अनुरोध
POST https://www.googleapis.com/drive/v3/files/{fileId}/permissions
यह यूआरएल, gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल करता है.
पाथ पैरामीटर
पैरामीटर |
fileId |
string
फ़ाइल या शेयर की गई ड्राइव का आईडी.
|
क्वेरी पैरामीटर
पैरामीटर |
emailMessage |
string
सूचना वाले ईमेल में शामिल करने के लिए, सादा टेक्स्ट वाला कस्टम मैसेज.
|
enforceSingleParent (deprecated) |
boolean
बंद कर दिया गया: ज़्यादा जानकारी के लिए, moveToNewOwnersRoot पर जाएं.
|
moveToNewOwnersRoot |
boolean
यह पैरामीटर सिर्फ़ तब लागू होगा, जब आइटम किसी शेयर की गई ड्राइव में न हो और अनुरोध में आइटम का मालिकाना हक ट्रांसफ़र करने की कोशिश की जा रही हो. अगर इसे true पर सेट किया जाता है, तो आइटम को नए मालिक के 'मेरी ड्राइव' के रूट फ़ोल्डर में भेज दिया जाएगा. साथ ही, सभी पुराने पैरंट फ़ोल्डर हटा दिए जाएंगे. अगर इसे false पर सेट किया जाता है, तो माता-पिता के खातों में कोई बदलाव नहीं होता.
|
sendNotificationEmail |
boolean
उपयोगकर्ताओं या ग्रुप के साथ शेयर करते समय, सूचना देने वाला ईमेल भेजना है या नहीं. उपयोगकर्ताओं और ग्रुप के लिए, यह डिफ़ॉल्ट रूप से true पर सेट होता है. साथ ही, अन्य अनुरोधों के लिए इसकी अनुमति नहीं है. मालिकाना हक ट्रांसफ़र करने के लिए, इसे बंद नहीं किया जाना चाहिए.
|
supportsAllDrives |
boolean
अनुरोध करने वाला ऐप्लिकेशन, 'मेरी ड्राइव' और शेयर की गई ड्राइव, दोनों के साथ काम करता है या नहीं.
|
supportsTeamDrives (deprecated) |
boolean
इस्तेमाल बंद कर दिया गया है: इसके बजाय, supportsAllDrives का इस्तेमाल करें.
|
transferOwnership |
boolean
क्या मालिकाना हक, बताए गए उपयोगकर्ता को ट्रांसफ़र करना है और मौजूदा मालिक को लेखक के तौर पर डाउनग्रेड करना है. इस पैरामीटर की ज़रूरत इसलिए होती है, ताकि साइड इफ़ेक्ट की पुष्टि की जा सके.
|
useDomainAdminAccess |
boolean
डोमेन एडमिन के तौर पर अनुरोध करें. अगर इसे सही पर सेट किया जाता है, तो अनुरोध करने वाले व्यक्ति को ऐक्सेस दिया जाएगा. ऐसा तब होगा, जब फ़ाइल आईडी पैरामीटर, शेयर की गई ड्राइव को रेफ़र करता हो और अनुरोध करने वाला व्यक्ति उस डोमेन का एडमिन हो जिससे शेयर की गई ड्राइव जुड़ी है.
|
enforceExpansiveAccess |
boolean
क्या अनुरोध में, ऐक्सेस से जुड़े ज़्यादा नियमों को लागू किया जाना चाहिए.
|
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में Permission
का उदाहरण है.
जवाब का मुख्य भाग
अगर एपीआई सही से जुड़ जाता है, तो जवाब के मुख्य हिस्से में Permission
का नया इंस्टेंस शामिल किया जाता है.
अनुमति के स्कोप
इसके लिए, इनमें से किसी एक OAuth स्कोप की ज़रूरत होती है:
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-08-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया."],[],[],null,["# Method: permissions.create\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\nCreates a permission for a file or shared drive.\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`POST https://www.googleapis.com/drive/v3/files/{fileId}/permissions`\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 of the file or shared drive. |\n\n### Query parameters\n\n| Parameters ||\n|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `emailMessage` | `string` A plain text custom message to include in the notification email. |\n| `enforceSingleParent` **(deprecated)** | `boolean` Deprecated: See `moveToNewOwnersRoot` for details. |\n| `moveToNewOwnersRoot` | `boolean` This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. If set to `true`, the item will be moved to the new owner's My Drive root folder and all prior parents removed. If set to `false`, parents are not changed. |\n| `sendNotificationEmail` | `boolean` Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers. |\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 to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. |\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/v3/permissions#Permission).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Permission](/workspace/drive/api/reference/rest/v3/permissions#Permission).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\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)."]]