Bug 813913 - role info does not reflect working permissions (permissions query broken?)
Summary: role info does not reflect working permissions (permissions query broken?)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: 2.0.6
Hardware: All
OS: All
unspecified
high
Target Milestone: ---
: Sprint 34
Assignee: Jason Connor
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On: 798803
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-18 18:22 UTC by Preethi Thomas
Modified: 2014-03-31 01:39 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 798803
Environment:
Last Closed: 2012-05-25 14:13:28 UTC
Embargoed:


Attachments (Terms of Use)

Description Preethi Thomas 2012-04-18 18:22:32 UTC
+++ This bug was initially created as a clone of Bug #798803 +++

Description of problem:

granted/revoked priveleges are not reflect on queried role views

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

Current (1.0)

How reproducible:

very

Steps to Reproduce:
1. pulp-admin -u admin -p admin user create --user test --password test
2. pulp-admin -u admin -p admin role create --role test
3. pulp-admin -u admin -p admin role add user --user=test --role=test
4. pulp-admin -u admin -p admin role info --role=test (this should output no permissions)
5. pulp-admin -u admin -p admin permission grant --resource /filters/ --role release -o read
6. pulp-admin -u admin -p admin role info --role=test
7. pulp-admin -u admin -p admin permission revoke --resource /filters/ --role release -o read
6. pulp-admin -u admin -p admin role info --role=test
  
Actual results:

step 6 should not output read permissions, but doesn't, I think the mongo query that retrieves the current role permissions DOESN'T return the proper permissions, but the permissions DO still work

Expected results:

"pulp-admin -u admin -p admin role info --role=test" should output the current working permissions

Additional info:

--- Additional comment from jconnor on 2012-04-12 16:38:33 EDT ---

Following steps 1-6 above, I get the following output on step 6:

$ pulp-admin -u admin -p admin role info --role=test
+------------------------------------------+
          Role Information for test
+------------------------------------------+
Name                	test                     
Users               	test                     
Permissions:
  /filters/                	READ

One thing to note about the instructions above, step 5, the grant is for a role called "resource" where the create and add are for a role called "test"

--- Additional comment from jconnor on 2012-04-13 12:04:27 EDT ---

Continuing on to step 7 results in:


[root@pulp-v1-server ~]# pulp-admin -u admin -p admin permission grant --resource /filters/ --role test -o read
Operations ['READ'] granted to role [ test ] on resource [ /filters/ ]

[root@pulp-v1-server ~]# pulp-admin -u admin -p admin role info --role=test+------------------------------------------+
          Role Information for test
+------------------------------------------+
Name                	test                     
Users               	test                     
Permissions:
  /filters/                	READ                     

[root@pulp-v1-server ~]# pulp-admin -u admin -p admin permission revoke --resource /filters/ --role test -o read
Operations ['READ'] revoked from role [ test ] on resource [ /filters/ ]

[root@pulp-v1-server ~]# pulp-admin -u admin -p admin role info --role=test+------------------------------------------+
          Role Information for test
+------------------------------------------+
Name                	test                     
Users               	test                     
Permissions:
  /filters/                	READ

--- Additional comment from jconnor on 2012-04-13 12:06:15 EDT ---

fix pushed to master in:
ef50effdc11f2ee888c0d1ef7a8ff1c707bcaf17
fix pushed to pulp_v1 in:
8d3be26864a6c2b8e58ed3426e59b09cea094930

--- Additional comment from jortel on 2012-04-13 15:05:19 EDT ---

build: 0.283

Comment 1 Preethi Thomas 2012-04-18 18:24:58 UTC
cloning for v2
moving to on_qa as per the comment 
fix pushed to master in:
ef50effdc11f2ee888c0d1ef7a8ff1c707bcaf17

Comment 2 Preethi Thomas 2012-04-19 18:26:09 UTC
[root@preethi-el6-pulp ~]# rpm -q pulp
pulp-0.0.284-1.el6.noarch

[root@preethi-el6-pulp ~]# pulp-admin -u admin -p admin user create --user test --password test
Successfully created user [ test ] with name [ None ]

[root@preethi-el6-pulp ~]#  pulp-admin -u admin -p admin role create --role test
Role [ test ] created

[root@preethi-el6-pulp ~]# pulp-admin -u admin -p admin role add user --user=test --role=test
[ test ] added to role [ test ]

[root@preethi-el6-pulp ~]# pulp-admin -u admin -p admin role info --role=test 
+------------------------------------------+
          Role Information for test
+------------------------------------------+
Name                	test                     
Users               	test                     
Permissions:

[root@preethi-el6-pulp ~]# pulp-admin -u admin -p admin permission grant --resource /filters/ --role test -o read
Operations ['READ'] granted to role [ test ] on resource [ /filters/ ]

[root@preethi-el6-pulp ~]# pulp-admin -u admin -p admin role info --role=test +------------------------------------------+
          Role Information for test
+------------------------------------------+
Name                	test                     
Users               	test                     
Permissions:
  /filters/                	READ                     

[root@preethi-el6-pulp ~]# pulp-admin -u admin -p admin permission revoke --resource /filters/ --role test -o read
Operations ['READ'] revoked from role [ test ] on resource [ /filters/ ]

[root@preethi-el6-pulp ~]# pulp-admin -u admin -p admin role info --role=test +------------------------------------------+
          Role Information for test
+------------------------------------------+
Name                	test                     
Users               	test                     
Permissions:

Comment 3 Preethi Thomas 2012-05-25 14:13:28 UTC
Pulp v1.1 Release


Note You need to log in before you can comment on or make changes to this bug.