-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RBAC for rss feeds #14041
Add RBAC for rss feeds #14041
Conversation
bc3af1e
to
4a9c1f6
Compare
app/models/rss_feed.rb
Outdated
rbac_options = {} | ||
if user_or_group | ||
user_or_group_key = user_or_group.kind_of?(User) ? :user : :miq_group | ||
rbac_options = {user_or_group_key => user_or_group} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think rbac_options[user_or_group_key] = user_or_group
is clearer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure 👍, changed, thanks
0326507
to
40ffd2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice Libor
@@ -27,7 +27,7 @@ item_class: Vm | |||
search_method: | |||
limit_to_time: | |||
limit_to_count: | |||
orderby: "created_on DESC" | |||
orderby: "vms.created_on DESC" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
@@ -9,22 +9,22 @@ def external? | |||
resource.nil? | |||
end | |||
|
|||
def generate(_user_or_group) | |||
def generate(user_or_group) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice touch. this flowed through very smoothly
kicking |
@lpichler I want to merge, but that failure looks like it is not going away |
40ffd2c
to
a1a3778
Compare
@@ -127,6 +127,9 @@ | |||
context "with new rss feed" do | |||
it "init status" do | |||
expect(MiqWidget.count).to eq(1) | |||
puts RssFeed.class | |||
puts RssFeed.methods.inspect | |||
puts RssFeed.ancestors.inspect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming these are in here for debugging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
@host2 = FactoryGirl.create(:host_microsoft, :created_on => @host1.created_on + 1.second) | ||
end | ||
|
||
it "#generate 2 hosts in newest_hosts rss" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this already covered by other tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just experimenting :/
I don't know what is happening here and why RssFeed is not model here https://travis-ci.org/ManageIQ/manageiq/jobs/205791463#L527 and I think that I did not make related change.
locally it is ActiveRecord
6dd891b
to
f31d512
Compare
1ff65b9
to
5b6abac
Compare
5e2fe0b
to
25a687e
Compare
to be able use it for RBAC
and process user or group as parameter for RBAC
otherwise it leads to error ambiguous column when RBAC was added.
25a687e
to
74351e9
Compare
Checked commits lpichler/manageiq@e31e658~...74351e9 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@miq-bot remove_label wip This PR is ready. |
Add RBAC for rss feeds (cherry picked from commit 6eea127) https://bugzilla.redhat.com/show_bug.cgi?id=1431168
Euwe backport details:
|
Backported to Darga via #14308 |
Add RBAC for rss feeds (cherry picked from commit 6eea127) https://bugzilla.redhat.com/show_bug.cgi?id=1431168
First part for https://bugzilla.redhat.com/show_bug.cgi?id=1418961
we have 2 yamls for RSS but only in one is orderby clause which is causing errors.
Links [Optional]
@miq-bot assign @gtanzillo
@miq-bot add_label bug, core