Update Folder Permissions ​
PUT /userapi/folderpermissions
To update permissions on a Folder, these same conditions apply as when you are adding permissions, and adding checks are made to ensure permissions exist already for the User or Security Group. Updating permissions can be achieved as per the example below, using the following parameter descriptions:
Powershell
#JSON data for the object
$Body = @{
FolderID = "2180"
Permission = "M"
ApplyPermissionsForSecurityGroupName = "Core Admins"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/userapi'
$result = Invoke-Restmethod -Method Put -Uri $PasswordstateURL'/folderpermissions' -ContentType "application/json" -Body $jsonData -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }
Write-Output $result| Heading | Data Type | Description |
|---|---|---|
| FolderID | Integer | Unique identifier for the Folder Read-only: The time at which the Folder was created. |
| Permission | String (1) | A for Administrator, M for Modify or V for View permissions |
| ApplyPermissionsForUserID | String (100) | The UserID you wish to apply permissions for |
| ApplyPermissionsForSecurityGroupID | Integer | The SecurityGroupID you wish to apply permissions for. You can only specify SecurityGroupID or SecurityGroupName, not both in the same call. |
| ApplyPermissionsForSecurityGroupName | String (NA) | The Security Group Name you wish to apply permissions for You can only specify SecurityGroupID or SecurityGroupName, not both in the same call. |
Json
# Response
HTTP/1.1 200
[
{
"FolderID":"2180",
"Permission":"M",
"ApplyPermissionsForUserID":"",
"ApplyPermissionsForSecurityGroupID":"312",
"ApplyPermissionsForSecurityGroupName":"Core Admins"
}
]