Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion lib/foreman_rh_cloud/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,37 @@ def self.register
:control_organization_insights,
'insights_cloud/settings': [:set_org_parameter]
)
# Insights Vulnerability permissions
permission(
:view_vulnerability,
{},
:resource_type => 'ForemanRhCloud'
)
permission(
:edit_vulnerability,
{},
:resource_type => 'ForemanRhCloud'
)
# Insights Advisor permissions
permission(
:view_advisor,
{},
:resource_type => 'ForemanRhCloud'
)
permission(
:edit_advisor,
{},
:resource_type => 'ForemanRhCloud'
)
end

plugin_permissions = [:view_foreman_rh_cloud, :generate_foreman_rh_cloud, :view_insights_hits, :dispatch_cloud_requests, :control_organization_insights]
# Core RH Cloud permissions for inventory upload and sync
rh_cloud_permissions = [:view_foreman_rh_cloud, :generate_foreman_rh_cloud, :view_insights_hits, :dispatch_cloud_requests, :control_organization_insights]

# Insights application permissions (Vulnerability, Advisor)
insights_permissions = [:view_vulnerability, :edit_vulnerability, :view_advisor, :edit_advisor]

plugin_permissions = rh_cloud_permissions + insights_permissions

role 'ForemanRhCloud', plugin_permissions, 'Role granting permissions to view the hosts inventory,
generate a report, upload it to the cloud and download it locally'
Comment on lines 106 to 107
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Update the role description to reflect the new Advisor and Vulnerability permissions.

Since this role now grants view/edit_vulnerability and view/edit_advisor, the description should also mention the Insights Vulnerability and Advisor access it provides so admins can understand its full scope.

Expand Down