IPWorks Cloud 2020 C++ Edition

Questions / Feedback?

UpdateSharedDrive Method

Updates a shared drive.

Syntax

ANSI (Cross Platform)
int UpdateSharedDrive(const char* lpszSharedDriveId, const char* lpszNewName, int iSetRestrictions, int iUnsetRestrictions);

Unicode (Windows)
INT UpdateSharedDrive(LPCWSTR lpszSharedDriveId, LPCWSTR lpszNewName, INT iSetRestrictions, INT iUnsetRestrictions);
- (void)updateSharedDrive:(NSString*)sharedDriveId :(NSString*)newName :(int)setRestrictions :(int)unsetRestrictions;
#define MID_GOOGLEDRIVE_UPDATESHAREDDRIVE 38

IPWORKSCLOUD_EXTERNAL int IPWORKSCLOUD_CALL IPWorksCloud_GoogleDrive_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method updates the name of and/or restrictions applied to the shared drive specified by SharedDriveId.

If the current user is allowed to rename the shared drive (i.e., if the SharedDriveCapabilities property has the 0x08000 flag set), then a new name can be provided using the NewName parameter. If the user is not allowed to rename the shared drive, or wishes to preserve its current name, pass empty string for NewName.

Similarly, if the current user is allowed to alter one or more of the shared drive's SharedDriveRestrictions (i.e., if the SharedDriveCapabilities property has the 0x00002, 0x00004, and/or 0x00010 flags set), then the desired restrictions can be set or unset by including their associated flags, listed below, in the values passed for the SetRestrictions and UnsetRestrictions parameters.

Hex Value Description
0x0001 Administrative privileges on the shared drive are required to modify restrictions.
0x0002 Readers and commenters cannot copy, print, or download files in the shared drive.
0x0004 Access to the shared drive, and its contents, is restricted to users in its domain.
0x0008 Access to items in the shared drive is restricted to its members.

Note that calls to this method will fail if:

  • A non-empty string is passed for NewName, but the current user isn't allowed to rename the shared drive.
  • The values passed for SetRestrictions and/or UnsetRestrictions contains any flag that corresponds to a restriction the current user isn't allowed to alter.
  • Any restriction flag appears in both SetRestrictions and UnsetRestrictions.

Changes requested using this method are "all-or-nothing"; e.g., if both a new name and a new set of restrictions are requested, but the current user isn't allowed to rename the shared drive, the entire request fails.

Error Handling (C++)

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 C++ Edition - Version 20.0 [Build 8265]