-
Notifications
You must be signed in to change notification settings - Fork 285
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
Fixes 5521: Adding permissions for managing subscriptions and manifests. #4042
Conversation
|
||
# Authorize must be before find_subscription since find_subscription reaches out to Candlepin | ||
# and needs a current user set | ||
before_filter :authorize |
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.
Why remove the before_filter :authorize
here?
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.
Handled by the base controller. We only ever did this so we could override it.
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.
What do you mean by "we did this so that we could override it"?. It seems the reason was the ordering, as the comment describes. It's possible the Katello as an engine made that code redundant though
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.
It was a mix of the old comment, and the issues brought with enginification effort. But at this juncture the call doesn't need to be there based on how things work.
ACK |
{ | ||
'katello/api/v2/subscriptions' => [:index, :show, :available] | ||
}, | ||
:resource_type => 'Organization' |
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.
Why not just?
permission :view_subscriptions,
{ 'katello/api/v2/subscriptions' => [:index, :show, :available] },
:resource_type => 'Organization'
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.
Makes it easier to add more routes/actions this way and we've done both the single item and multi-item hashes the same way this way.
ack - permission granularity looks good to me. thanks! |
Fixes 5521: Adding permissions for managing subscriptions and manifests.
No description provided.