Add Password Permissions ​
POST /winapi/passwordpermissions
Adding permissions to a Password record can be achieved as per the example below, using the following parameter descriptions:
Powershell
#JSON data for the object
$Body = @{
PasswordID = $PasswordID
Permission = "V"
ApplyPermissionsForSecurityGroupName = "Core Admins"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/winapi'
$result = Invoke-Restmethod -Method Post -Uri $PasswordstateURL'/passwordpermissions' -ContentType "application/json" -Body $jsonData -UseDefaultCredentials
Write-Output $result| Heading | Data Type | Description |
|---|---|---|
| PasswordID | Integer | Unique identifier for the Password Read-only: The time at which the Password was created. |
| Permission | String (1) | 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
[
{
"PasswordID":"37180",
"Permission":"V",
"ApplyPermissionsForUserID":"",
"ApplyPermissionsForSecurityGroupID":"312",
"ApplyPermissionsForSecurityGroupName":"Core Admins"
}
]