Skip to content
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

Merged
merged 1 commit into from
May 5, 2014

Conversation

ehelms
Copy link
Member

@ehelms ehelms commented May 2, 2014

No description provided.

@ehelms ehelms changed the title Fixes 5521 Fixes 5521: Adding permissions for managing subscriptions and manifests. May 2, 2014

# Authorize must be before find_subscription since find_subscription reaches out to Candlepin
# and needs a current user set
before_filter :authorize
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member

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

Copy link
Member Author

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.

@waldenraines
Copy link
Contributor

ACK

{
'katello/api/v2/subscriptions' => [:index, :show, :available]
},
:resource_type => 'Organization'
Copy link
Member

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'

Copy link
Member Author

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.

@thomasmckay
Copy link
Member

ack - permission granularity looks good to me. thanks!

ehelms added a commit that referenced this pull request May 5, 2014
Fixes 5521: Adding permissions for managing subscriptions and manifests.
@ehelms ehelms merged commit ad368d6 into Katello:roles May 5, 2014
@ehelms ehelms deleted the fixes-5521 branch May 5, 2014 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants