Delete Password Permissions ​
DELETE /winapi/passwordpermissions
To delete permissions from a Password record, 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. Deleting permissions can be achieved as per the example below, using the following parameter descriptions:
Powershell
#JSON data for the object
$Body = @{
PasswordID = $PasswordID
ApplyPermissionsForSecurityGroupName = "Core Admins"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/winapi'
$result = Invoke-Restmethod -Method Delete -Uri $PasswordstateURL'/passwordpermissions' -ContentType "application/json" -Body $jsonData -UseDefaultCredentials| Heading | Data Type | Description |
|---|---|---|
| PasswordID | Integer | Unique identifier for the Password Read-only: The time at which the Password was created. |
| Permission | String (1) | This is optional. If omitted, all permissions for the User or Security Group will be deleted. Or you can specify specific permissions using M for Modify or V for View permissions |
| ApplyPermissionsForUserID | String (100) | The UserID you wish to delete permissions for |
| ApplyPermissionsForSecurityGroupID | Integer | The SecurityGroupID you wish to delete 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 delete permissions for You can only specify SecurityGroupID or SecurityGroupName, not both in the same call. |