# Update Permissions

Set permissions on a file or folder in external storage from Apex.

> Kind: Apex method · Updated: 2026-07-01

## Signature

```apex
global static void updatePermissions(
  List<Types.PermissionInput> permissionInputs,
  String library,
  String runAs
)
```

### Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| permissionInputs | List&lt;<a href="#/apex-type-permission-input">Types.PermissionInput</a>&gt; | required | List of Types.PermissionInput entries describing the permission changes to apply. |
| library | String | required | Type of library. Example — sharepoint. You can get this value from your Content Library. |
| runAs | String | optional | Email ID of the user on whose behalf the function should run. To run the action as the automation user, supply integrationUser. |

## Return Type

void

## Example

```apex
List<cldfs.Types.PermissionInput> permissionInputs = new List<cldfs.Types.PermissionInput>{
   new cldfs.Types.PermissionInput('grant', 'write', '01BXPY7JP4Q3T32A2NDFFINJFMIIVL2B4Q', 'file', 'b!CiFUkdxwFEKQCdK8T8qY60NOJiIwBzxLqNUvhN3EhhxklKcoC3hIQboLLnFIpAQs', new List<String>{'testuser@gmail.com'}, new List<String>{}, new List<String>{})
 };

cldfs.Client.updatePermissions(
  permissionInputs,
  'sharepoint',
  'integrationUser'
);
```
