Bug 871073

Summary: Cannot create alert on group level
Product: [Other] RHQ Project Reporter: vlad crc <vlad.craciunoiu>
Component: AlertsAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED DUPLICATE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.4CC: hrupp
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: 2013-03-27 04:28:46 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description vlad crc 2012-10-29 10:42:58 EDT
Description of problem:
Cannot create alert on group level when logged in as user with limited permissions.


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



How reproducible:
always



Steps to Reproduce:
Define a resource compatible group.
Define a role with permission to edit alerts on that group.
Define a user and assign it to that role.
Log in as that user.
Try to define an alert on group level, or on any node from the group tree browser.



Actual results:

Got error:
------------------------
java.lang.RuntimeException:[1351514874687] javax.ejb.EJBException:java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: group of: org.rhq.core.domain.alert.AlertDefinition [SELECT alertdefinition
FROM org.rhq.core.domain.alert.AlertDefinition alertdefinition
LEFT JOIN FETCH alertdefinition.groupAlertDefinition
WHERE ( alertdefinition.resourceGroup.id IN ( :resourceGroupIds )
AND alertdefinition.deleted = :deleted )
AND ( alertdefinition.group.id IN ( SELECT innerAlias.group.id
FROM alertdefinition innerAlias
JOIN innerAlias.group.roles r JOIN r.subjects s
WHERE s.id = 10131 )
OR
alertdefinition.group.id IN ( SELECT innerAlias.group.id
FROM alertdefinition innerAlias
JOIN innerAlias.group.clusterResourceGroup crg JOIN crg.roles r JOIN r.subjects s
WHERE crg.recursive = true AND s.id = 10131 )
OR
alertdefinition.group.id IN ( SELECT innerAlias.group.id
FROM alertdefinition innerAlias
JOIN innerAlias.group.subject s
WHERE s.id = 10131 ) )

] -> java.lang.IllegalArgumentException:org.hibernate.QueryException: could not resolve property: group of: org.rhq.core.domain.alert.AlertDefinition [SELECT alertdefinition
FROM org.rhq.core.domain.alert.AlertDefinition alertdefinition
LEFT JOIN FETCH alertdefinition.groupAlertDefinition
WHERE ( alertdefinition.resourceGroup.id IN ( :resourceGroupIds )
AND alertdefinition.deleted = :deleted )
AND ( alertdefinition.group.id IN ( SELECT innerAlias.group.id
FROM alertdefinition innerAlias
JOIN innerAlias.group.roles r JOIN r.subjects s
WHERE s.id = 10131 )
OR
alertdefinition.group.id IN ( SELECT innerAlias.group.id
FROM alertdefinition innerAlias
JOIN innerAlias.group.clusterResourceGroup crg JOIN crg.roles r JOIN r.subjects s
WHERE crg.recursive = true AND s.id = 10131 )
OR
alertdefinition.group.id IN ( SELECT innerAlias.group.id
FROM alertdefinition innerAlias
JOIN innerAlias.group.subject s



Expected results:
alert should be created successfully on group level.



Additional info:
If I login with rhqadmin user alert is successfully created.
Comment 1 vlad crc 2013-03-27 04:28:46 EDT

*** This bug has been marked as a duplicate of bug 846451 ***