Bug 861092

Summary: ContentManager findPackagesByCriteria() doesn't get correct manage repository permissions
Product: [Other] RHQ Project Reporter: Armine Hovsepyan <ahovsepy>
Component: CLIAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: low    
Version: 4.5CC: hrupp, mfoley
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Armine Hovsepyan 2012-09-27 09:45:07 EDT
Description of problem:
In CLI ContentManage.findPackagesByCritera for given subject throws exception
"Wrapped org.rhq.enterprise.server.authz.PermissionException: [Warning] Only repository managers can search for packages across all repos. (<Unknown source>#1)" while the given subject (user) has  Manage Repositories permission.


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

How reproducible:
always

Steps to Reproduce:
1. create Role with Manage Repositories permission (r1)
2. create user with the (r1) role (u1)
3. log in with (u1) user (logedInUser)
4. create private repository with (u1) user
5. create default PackageCriteria (pckgCriteria)
6. call the following command - ContentManager.findPackagesByCriteria(logedinUser, pckgCriteria)
  
Actual results:
"Wrapped org.rhq.enterprise.server.authz.PermissionException: [Warning] Only repository managers can search for packages across all repos. (<Unknown source>#1)"  exception is thrown

Expected results:
Method should return correct list of Packages.


Additional info:
On GUI permissions work correctly.