-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Approvals are being bypassed for group members but not if group members are approvers #153
Comments
I just discovered this same issue. I was hoping to have our intern be able to start jobs but require approval, but it looks like the current work around would enable him to approve jobs from other people in the group, which somewhat defeats the purpose. |
@dreznicek Thank you so much for catching this logic bug! |
@devblackops I don't know if its something I'm doing or if I was still using my branch, but I can't get approvals to work at all in
The |
Hey @dreznicek, can you share the |
@devblackops Thanks for looking, sir! Here's the Approval Config...
I put any users in the If I do take out the Approval Config, then the behavior for permissions works correctly. If I give the user the right permissions via group and role, it works as expected...they can either execute the command or they cannot. Lemme know if you need me to make a slimmed down module to replicate. |
@devblackops don't know if you've had a chance to look into this or if I need to create a new issue? |
@dreznicek Have you tried the latest version This is what I just tested with success: Can you try the following procedure (with PoshBot
ApprovalConfiguration = @{
ExpireMinutes = 30
Commands = @(
@{
Expression = 'PoshBot.Networking:*'
Groups = @('network-jockeys')
PeerApproval = $false
}
)
}
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Expected Behavior
The expected behavior is:
If user1 is in a group (groupA) and a command requires an approval from user2 in a different group (groupB), then the command when executed by user1 should prompt for approval.
Current Behavior
If user1 in groupA, tries to run a command that requires approval from user2 in groupB, the command is exectued without any approval process. In the log it shows that the user does not require approval to run the command.
But, If you put user1 and user2 in both groupA and groupB and
PeerApproval
for the command is set to$true
, the process works as intended. The user (ie, user1) get's prompted that approval is needed, a different member of groupB (ie, user2) can then approve and the command is executed.Possible Solution
It appears that the current code is only running logic to determine if the executing user is in the approval group (groupB) and if they are not, then the else statement kicks which is that approval is not needed.
I have a PR coming that addresses this issue.
Steps to Reproduce (for bugs)
To Reproduce groupA issue:
Permission
(_permissionA) in your moduleApproval Configuration
with an Expression for executing commandA, setPeerApproval
to$true
NOTE:
If you put user1 and user2 in both groupA
and
groupB, approval process does kick in.Context
We are working on an approval process for user commands that a product team can execute on remote servers, but need to have them approved before executing so we can have a business group approval in the process.
Your Environment
The text was updated successfully, but these errors were encountered: