Add Privileged Account Credential Permission ​
POST /winapi/privaccountpermissions
Permissions are required on Privileged Account Credentials, if you want user's to have access to the Privileged Account Credential i.e. so they can configure Password Resets, Account Discovery Jobs, etc. The account executing this call must have the Privileged Account Credentials Security Administrator's role in Passwordstate.
Adding permissions can be achieved as per the example below, using the following parameter descriptions:
Powershell
#JSON data for the object
$Body = @{
PrivilegedAccountID = "7"
ApplyPermissionsForSecurityGroupName = "Core Admins"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/winapi'
$result = Invoke-Restmethod -Method Post -Uri $PasswordstateURL'/privaccountpermissions' -ContentType "application/json" -Body $jsonData -UseDefaultCredentials
Write-Output $result| Heading | Data Type | Description |
|---|---|---|
| PrivilegedAccountID | Integer | Unique identifier for the Privileged Account Credential Read-only: Created automatically at the time the Privileged Account Credential was added. |
| 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. |
Note: If you specify the value of 0 for ApplyPermissionsForUserID and ApplyPermissionsForSecurityGroupID, then All Users and Security Groups will be granted access. Equivalent to "All Users and Security Groups" you see in the UI.
Json
# Response
HTTP/1.1 200
[
{
"PrivilegedAccountID":"7",
"ApplyPermissionsForUserID":"0",
"ApplyPermissionsForSecurityGroupID":"312",
"ApplyPermissionsForSecurityGroupName":"Core Admins"
}
]