RemoveSharedDriveMember Method

Removes an existing shared drive member.

Syntax

int RemoveSharedDriveMember(const QString& qsSharedDriveId, const QString& qsPermissionId);

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);

Error Handling

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

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