ListPermissions Method

Lists the permissions for a file, folder, or shared drive.

Syntax

int ListPermissions(const QString& qsResourceId);

Remarks

This method is used to list permissions for the file, folder, or shared drive specified by ResourceId.

Calling this method will fire the PermissionList event once for each permission, and will also populate the Permission* properties.

If there are still more permissions available to list when this method returns, the PermissionMarker property will be populated. Continue to call this method until PermissionMarker is empty to accumulate all pages of results in the Permission* properties.

// PermissionList event handler.
googledrive.OnPermissionList += (s, e) => {
  Console.WriteLine("Permission Id: " + e.Id);
};

// List all of the permissions on the given resource.
do {
  googledrive.ListPermissions("fdjhskdf89o3wi");

  for (int i = 0; i < googledrive.Permissions.Count; i++) {
    // Process permissions here.
  }
} while (!string.IsNullOrEmpty(googledrive.PermissionMarker));

Shared Drive Members

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.

Shared Drive Capabilities

To determine the effective capabilities the current user has for shared drives that they're a member of, call ListSharedDrives instead and inspect the SharedDriveCapabilities property of the returned items.

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]