Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-TppPermission - replaces all existed permissions #197

Closed
tall27 opened this issue Apr 14, 2023 · 3 comments · Fixed by #204
Closed

Set-TppPermission - replaces all existed permissions #197

tall27 opened this issue Apr 14, 2023 · 3 comments · Fixed by #204
Assignees
Labels
enhancement New feature or request

Comments

@tall27
Copy link

tall27 commented Apr 14, 2023

Environment

Operating System: win
VenafiPS version: 5.4.1
PowerShell version: 7
TPP version (if applicable): 22.4

Steps to reproduce

$list=find-TppObject -Path '\ved\policy' -Class 'Policy'|Get-TppPermission
$i = 1
foreach ($identity in $list) {
if (($identity).EffectivePermissions.IsWriteAllowed ) {
Set-TppPermission -Path $identity.Path -IdentityId $identity.IdentityId -Permission @{IsPrivateKeyReadAllowed=$true}
}
$i++
}

Expected behavior

I'd expect only a single permission being added.

Actual behavior

all other permissions are reset ( removed)

Screenshots

@gdbarron
Copy link
Collaborator

Hi @tall27. This is how the function currently is expected to work. -Permission expects a full permissions object

.PARAMETER Permission
TppPermission object.  You can create a new object or get existing object from Get-TppPermission.

Only providing individual permissions will cause the rest to be set to false. We could look to make an enhancement to override this behavior and update an existing permissions object individual perms.

For now, I'd suggest what the parameter help states. Get the existing via Get-TppPermission, update the perms you'd like, and send that as your permissions object.

@gdbarron
Copy link
Collaborator

gdbarron commented May 1, 2023

@tall27 would you mind testing the update?

@gdbarron gdbarron self-assigned this May 1, 2023
@gdbarron gdbarron added the enhancement New feature or request label May 1, 2023
@DadsVacayShorts
Copy link

I pulled the update , but I as this PR doesn't have the test-tppidentity fix from 206 it fails in my environment. Time permitting I may pull just that update and put it in my local repo and re-test.
Here's the wrong format message when I test this update for set-tpppermission which I assume is the period in the identity connector name.

'AD+galaxylab.private:09904781855e7245aaf535c5c65b26d0' is not a valid Prefixed Universal Id format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants