Bug 1021924

Summary: can't revoke multiple permissions at the same time using bkr policy-revoke
Product: [Retired] Beaker Reporter: wangjing <jingwang>
Component: command lineAssignee: Dan Callaghan <dcallagh>
Status: CLOSED NOTABUG QA Contact: tools-bugs <tools-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 0.15CC: aigao, asaha, dcallagh, qwan, rmancy, tools-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-13 03:43:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description wangjing 2013-10-22 10:35:45 UTC
Description of problem:
can't revoke all permissions at once via CLI 'bkr policy-grant', only revoke one permission(the last one):

Version-Release number of selected component (if applicable):
Version 0.15.1rc1

How reproducible:
always

Steps to Reproduce:
1. grant all permissions at once:
bkr policy-grant --system=dev-kvm-guest-09.rhts.eng.bos.redhat.com --permission=control_system --permission=edit_policy --permission=edit_system --permission=loan_any --permission=loan_self --permission=reserve --group=xjia --user=tfeng --everybody

2. then revoke all permissions:
bkr policy-revoke --system=dev-kvm-guest-09.rhts.eng.bos.redhat.com --permission=control_system --permission=edit_policy --permission=edit_system --permission=loan_any --permission=loan_self --permission=reserve --group=xjia --user=tfeng --everybody

3. check the result via web

Actual results:
only permission reserve was revoked for the three targets.

Expected results:
all permissions should be revoked for the three targets.

Additional info:

Comment 2 Nick Coghlan 2013-10-25 00:51:34 UTC
Indeed, the logic in the policy-revoke command is not correct - it needs to use the same structure as the policy-grant command.

Both policy-grant and policy-revoke need additional integration tests that cover granting/revoking multiple permissions at once, as well as multiple users and groups in the same command.

Comment 3 Dan Callaghan 2014-11-13 03:43:30 UTC
I cannot reproduce this problem.

Here is a pair of test cases which show it working properly as well:

http://gerrit.beaker-project.org/3484

As far as I can see nothing has changed here since 0.15 so I'm not sure what was going wrong...