IPWorks Cloud 2020 Node.js Edition

Questions / Feedback?

RemoveSharedDriveMember Method

Removes an existing shared drive member.

Syntax

googledrive.removeSharedDriveMember(sharedDriveId, permissionId, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This is a convenience method that removes an existing member of a shared drive (specified by SharedDriveId) by deleting their associated permission (specified by PermissionId).

Refer to UpdatePermissions for more information about how permissions work in general, how permissions relate to shared drive members, and how to manipulate multiple members at once.

string sharedDriveId = "20983euijdsds";
// First, we'll add a new member to the shared drive. The two integer parameters signify:
// * The role type. 2 is the "Writer" role, which provides read and write (but not organize) permissions.
// * The permission type. 0 means this is a single user (versus a group).
// The Id of the new permission we've created on the shared drive--which is what actually causes the user to
// be a member of the shared drive--is returned.
string permId = googledrive.AddSharedDriveMember(sharedDriveId, 2, 0, "fakeuser@example.com");

// At some point later, perhaps this user has abused their privileges and we wish to revoke their writer
// permissions. We change their role to "Commenter", which provides reader and commenting permissions.
googledrive.UpdateSharedDriveMember(sharedDriveId, permId, 1); // 1 is the "Commenter" role.

// Or perhaps we wish to simply remove the user's shared drive membership completely.
googledrive.RemoveSharedDriveMember(sharedDriveId, permId);

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Node.js Edition - Version 20.0 [Build 8265]