Bug 1330713 - In Horizon, when going to Manila and then clicking 'share' then 'share network' without admin privileges, the user will be logged out
Summary: In Horizon, when going to Manila and then clicking 'share' then 'share networ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-manila
Version: 7.0 (Kilo)
Hardware: x86_64
OS: Linux
high
high
Target Milestone: async
: 10.0 (Newton)
Assignee: Tom Barron
QA Contact: nlevinki
Don Domingo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-26 18:41 UTC by nalmond
Modified: 2019-10-10 11:59 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-17 19:46:32 UTC
Target Upstream Version:


Attachments (Terms of Use)
screen shot of horizon following reproduction steps as unprivileged demo user (64.67 KB, image/png)
2016-11-17 19:42 UTC, Tom Barron
no flags Details

Description nalmond 2016-04-26 18:41:21 UTC
Description of problem:
In Horizon, when going to Manila and then clicking 'share' then 'share network' without admin privileges, the user will be logged out

How reproducible:
Every time

Steps to Reproduce:
1. Log in to Horizon as user without admin privileges
2. Go to Manila -> Share
3. Click 'Share network' button

Actual results:
The user is logged out

Expected results:
The button is unclickable

Additional info:
This behavior is very similar to https://bugzilla.redhat.com/show_bug.cgi?id=1326146

Comment 3 Itxaka 2016-04-27 09:15:06 UTC
Trying to reproduce this I am unable to.

Using:

horizon: Red Hat Kilo branch
manila-ui: Kilo branch
manila installed from packstack:
Name        : openstack-manila
Arch        : noarch
Version     : 2015.1.0
Release     : 2.el7ost


Created a new tenant "test"
Created a new user "test" member of tenant "test"
Logged in as "test" user
Went to "Shares" -> "Share networks"
Added a new "Share Network"

Also I created several shares and deleted them, went all over the shares menus/buttons/tabs but could not trigger this issue.


Can we got more logs or a more detailed walktrougth on how to trigger this? Seems like Im missing something, for example:

I dont have a manila -> shares submenu on RHOS7. My "Shares" item is in the compute part directly.
I dont really understand which one is the 'Share network' button. Is that a tab? Is that the "Create Share Network" button? Can I get a screenshot of it please?


Thanks!

Comment 4 David Hill 2016-04-27 15:43:43 UTC
Hello sir,

    If you go back in the "Share" -> "Share networks" and click on any of the shared networks, it will log you out if the user doesn't have the admin role.

Thank you very much,

David Hill

Comment 6 Itxaka 2016-04-28 08:30:28 UTC
This is a manila-ui issue, althougth the origin can be pointed to horizon, it has to be fixed on the manila-ui project.

Just to be clear, the issue is very simple.
User has a list of share networks and each share network has a link in the name to see the details of the share.
But when clicking on it, the user is facing with an error. This is due to the normal user not having enough privileges to view that share details.

The way this was fixed on horizon on the patch mentioned in the bug was to check for user privileges _before_ adding the link, thus no privileges, no link.

Unfortunately, after a couple of tests I cannot apply the same patch style to manila-ui, as the policy checks for permission pass, but in the end is the manila service the one that denies the user access to those details, so it looks like something else is wrong (policy check maybe).


A very simple workaround for this (tested myself locally) is to edit the manila /etc/manila/policy.json file and change:

"share_server:index": [["rule:admin_api"]],

to:

"share_server:index": [["rule:default"]],


And restart manila services (share, scheduler, api)


Would this be good enough as a workaround for them?

Comment 7 Matthias Runge 2016-05-02 11:42:51 UTC
Is it right to state, the proposed change does NOT require any change in Horizon?
Is that the solution? If it's a manila setup issue, then the bug should be either on manila component or on the installer, right?

Comment 8 Dave Maley 2016-05-02 15:38:12 UTC
As noted in comment 6 this can be worked around via a config change in the manilla policy.json thus moving to manilla-ui. If this is something that should be addressed in osp-d please go ahead and move it there. Thanks!

Comment 9 Matthias Runge 2016-05-02 17:26:41 UTC
Moving to openstack-manila, the policy file belongs to manila, not manila-ui.

Comment 10 Itxaka 2016-06-06 11:20:05 UTC
removing the needinfo

Comment 12 Tom Barron 2016-11-17 19:42:46 UTC
Created attachment 1221628 [details]
screen shot of horizon following reproduction steps as unprivileged demo user

Comment 13 Tom Barron 2016-11-17 19:45:44 UTC
This bug was filed for a tech-preview release (OSP-7) and has a workaround (see https://bugzilla.redhat.com/show_bug.cgi?id=1330713#c6).  We kept it open to make sure that we checked the first GA release, OSP-10, to see if the issue persisted and if so, fix it there.

I've deployed with a current OSP-10 puddle via OSP-D, created a non-privileged
demo user, logged into horizon running in the deployment as the demo user, and
am not able to reproduce the issue following the steps in the description.  See
https://bugzilla.redhat.com/attachment.cgi?id=1221628 where I've progressed as
user demo through Share -> Share Network to Share -> Share Network -> Create Share Network without any issue.

There's nothing to fix here so I'm going to close this one out.


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