Google Drive में मौजूद किसी फ़ाइल से जुड़ा उपयोगकर्ता. उपयोगकर्ताओं को File.getEditors()
, Folder.getViewers()
, और अन्य तरीकों से ऐक्सेस किया जा सकता है.
// Log the email address of all users who have edit access to a file. const file = DriveApp.getFileById('1234567890abcdefghijklmnopqrstuvwxyz'); const editors = file.getEditors(); for (let i = 0; i < editors.length; i++) { Logger.log(editors[i].getEmail()); }
तरीके
तरीका | रिटर्न टाइप | संक्षिप्त विवरण |
---|---|---|
get | String | उपयोगकर्ता के खाते से जुड़ा डोमेन नेम पाता है. |
get | String | उपयोगकर्ता का ईमेल पता पाता है. |
get | String | उपयोगकर्ता का नाम दिखाता है. |
get | String | उपयोगकर्ता की फ़ोटो का यूआरएल पाता है. |
अब काम न करने वाले तरीके
तरीका | रिटर्न टाइप | संक्षिप्त विवरण |
---|---|---|
| String | उपयोगकर्ता का ईमेल पता पाता है. |
ज़्यादा जानकारी वाला दस्तावेज़
getDomain()
उपयोगकर्ता के खाते से जुड़ा डोमेन नेम पाता है.
// Log the domain names associated with all users who have edit access to a // file. const file = DriveApp.getFileById('1234567890abcdefghijklmnopqrstuvwxyz'); const editors = file.getEditors(); for (let i = 0; i < editors.length; i++) { Logger.log(editors[i].getDomain()); }
वापसी का टिकट
String
— उपयोगकर्ता के खाते से जुड़ा डोमेन नेम
getEmail()
उपयोगकर्ता का ईमेल पता पाता है. उपयोगकर्ता का ईमेल पता सिर्फ़ तब उपलब्ध होता है, जब उपयोगकर्ता ने Google+ खाते की सेटिंग पेज से पता शेयर करने का विकल्प चुना हो. इसके अलावा, यह तब भी उपलब्ध होता है, जब उपयोगकर्ता उसी डोमेन से जुड़ा हो जिस डोमेन से स्क्रिप्ट चलाने वाले उपयोगकर्ता का जुड़ाव है. साथ ही, डोमेन एडमिन ने डोमेन के सभी उपयोगकर्ताओं को दूसरे उपयोगकर्ताओं के ईमेल पते देखने की अनुमति दी हो.
// Log the email address of all users who have edit access to a file. const file = DriveApp.getFileById('1234567890abcdefghijklmnopqrstuvwxyz'); const editors = file.getEditors(); for (let i = 0; i < editors.length; i++) { Logger.log(editors[i].getEmail()); }
वापसी का टिकट
String
— उपयोगकर्ता का ईमेल पता या अगर ईमेल पता उपलब्ध नहीं है, तो खाली स्ट्रिंग
getName()
उपयोगकर्ता का नाम दिखाता है. अगर उपयोगकर्ता का नाम उपलब्ध नहीं है, तो यह तरीका null
दिखाता है.
// Log the names of all users who have edit access to a file. const file = DriveApp.getFileById('1234567890abcdefghijklmnopqrstuvwxyz'); const editors = file.getEditors(); for (let i = 0; i < editors.length; i++) { Logger.log(editors[i].getName()); }
वापसी का टिकट
String
— उपयोगकर्ता का नाम या नाम उपलब्ध न होने पर null
getPhotoUrl()
उपयोगकर्ता की फ़ोटो का यूआरएल पाता है. अगर उपयोगकर्ता की फ़ोटो उपलब्ध नहीं है, तो यह तरीका null
दिखाता है.
// Log the URLs for the photos of all users who have edit access to a file. const file = DriveApp.getFileById('1234567890abcdefghijklmnopqrstuvwxyz'); const editors = file.getEditors(); for (let i = 0; i < editors.length; i++) { Logger.log(editors[i].getPhotoUrl()); }
वापसी का टिकट
String
— उपयोगकर्ता की फ़ोटो का यूआरएल या फ़ोटो उपलब्ध न होने पर null
अब काम न करने वाले तरीके
getUserLoginId()
getUserLoginId()
अब काम नहीं करता. 24 जून, 2013 से, इसे get
से बदल दिया गया है.
उपयोगकर्ता का ईमेल पता पाता है.
// Log the email address of the person running the script. Logger.log(Session.getActiveUser().getUserLoginId());
वापसी का टिकट
String
— उपयोगकर्ता का ईमेल पता.