Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 782022 - UI permissions review
Summary: UI permissions review
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: 6.0.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Garik Khachikyan
URL:
Whiteboard:
Depends On:
Blocks: katello-blockers
TreeView+ depends on / blocked
 
Reported: 2012-01-16 11:27 UTC by Lukas Zapletal
Modified: 2019-09-25 21:08 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-22 18:19:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 771411 0 unspecified CLOSED Refactor distributions route 2021-02-22 00:41:40 UTC

Internal Links: 771411

Description Lukas Zapletal 2012-01-16 11:27:02 UTC
During my premissions API review and implementation this sprint I was 
also looking in the UI controller code and I have found there is the 
following construct in many places:

skip_before_filter :authorize #load the environment
before_filter :find_environment
before_filter :authorize

The skip_before_filter call is not needed in this case, so I have 
removed it from all UI controllers. I did this because now we can track
skip_before_filter lines with grep:

If you do

git grep "skip_before_filter :authorize"

you will find the following UI controllers that has (for some reason) 
disabled authorize call.

app/controllers/accounts_controller.rb
app/controllers/dashboard_controller.rb
app/controllers/errata_controller.rb
app/controllers/errors_controller.rb
app/controllers/notices_controller.rb

When I was sure it is our intention I commented it to see those lines 
with grep:

skip_before_filter :authorize # ok - is used by warden

On top of that the following controllers either do not have rules 
implemented or do not have authorize filter enabled:

packages_controller.rb
distributions_controller.rb
errata_controller.rb
templates_content_controller.rb (authorize filter call is missing)

The list is not complete. I am creating a new BZ for UI permissions 
review. It's target is to comment all skip_before_filter :authorize 
lines where appropriate, remove the rest and add rules to all 
controllers.

Comment 1 Lukas Zapletal 2012-01-16 11:29:05 UTC
Please let me know once you will be implementing rules for

packages_controller.rb
distributions_controller.rb
errata_controller.rb

Because those are not implemented in the API as well.

Comment 2 Lukas Zapletal 2012-01-16 13:28:15 UTC
Please note for distributions I already enriched the UI code with some comments. A route change is needed. Tracking BZ is:

https://bugzilla.redhat.com/show_bug.cgi?id=771411

Comment 3 Justin Sherrill 2012-03-05 13:51:49 UTC
Added permissions to packages and errata controllers.  I ended up not adding repoids for everything in the routes, to simplify the change.  Now that errata and packages are returning  repoids from pulp, checking permissions is very easy. 

05cda575fd8442aeeaa954ab5f3fad36d3622483

Comment 4 Justin Sherrill 2012-03-05 13:54:01 UTC
An easy way to test:

1.  go to promotions page with a repo synced
2.  Navigate to packages
3.  with chrome/firefox with firebug inspect a package and grab the link (i.e. /katello/packages/ca934dc5-f150-4926-990e-a8966f8a7a82)
4.  Browse to this URL (should work).
5.  Create a user that does not have a permission to access the provider for this repo
6.  Try to access the same URL (Shouldn't work).

Do the same for errata.

Comment 6 Mike McCune 2012-03-07 23:43:36 UTC
mass move ON_QA after brewing

Comment 8 Garik Khachikyan 2012-03-22 10:29:42 UTC
# COMMENT

comment#4 just checked for packages - works.

doing one for erratas now...

Comment 9 Garik Khachikyan 2012-03-22 10:36:13 UTC
# VERIFIED

same as for packages.

pushing the bug to verified now.

checked against:

---
mod_wsgi-3.3-3.pulp.el6.x86_64
katello-common-0.2.15-1.git.6.baa234a.el6.noarch
pulp-selinux-server-1.0.0-6.el6.noarch
katello-repos-testing-0.2.1-1.el6.noarch
qpid-cpp-server-ssl-0.12-6.el6.x86_64
candlepin-0.5.26-1.el6.noarch
candlepin-tomcat6-0.5.26-1.el6.noarch
katello-certs-tools-1.1.3-1.el6.noarch
qpid-cpp-server-0.12-6.el6.x86_64
katello-glue-pulp-0.2.15-1.git.6.baa234a.el6.noarch
katello-0.2.15-1.git.6.baa234a.el6.noarch
qpid-cpp-client-ssl-0.12-6.el6.x86_64
katello-qpid-client-key-pair-1.0-1.noarch
katello-cli-common-0.2.15-1.git.4.8503392.el6.noarch
katello-cli-0.2.15-1.git.4.8503392.el6.noarch
m2crypto-0.21.1.pulp-7.el6.x86_64
python-oauth2-1.5.170-2.pulp.el6.noarch
pulp-common-1.0.0-6.el6.noarch
qpid-cpp-client-0.12-6.el6.x86_64
katello-glue-candlepin-0.2.15-1.git.6.baa234a.el6.noarch
katello-selinux-0.2.3-1.git.57.6c5edb8.el6.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-agent-1.0.3-1.git.0.cccd0b4.el6.noarch
python-qpid-0.12-1.el6.noarch
katello-glue-foreman-0.2.15-1.git.6.baa234a.el6.noarch
pulp-1.0.0-6.el6.noarch
katello-repos-0.2.1-1.el6.noarch
katello-configure-0.2.15-1.git.4.94aa90a.el6.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
---

Comment 11 Mike McCune 2013-08-16 18:19:30 UTC
getting rid of 6.0.0 version since that doesn't exist


Note You need to log in before you can comment on or make changes to this bug.