Non-admin user can't get the share network details

Bug #1702396 reported by Lei Xiao
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
manila-ui
Fix Released
Medium
Goutham Pacha Ravi

Bug Description

Following below steps to reproduce the issue:
(1) login openstack web-ui with a non-admin user
(2) create a share network
(3) click the link of new share network to view the details
then an error with message: "Error: Unable to retrieve share network details." pop-up.

I checked the code in the manila-ui/dashboards/project/share-networks/views.py, it will try to get the share server list in the function get_data of Class Detail(line 114):
----------------------------------------------------------------------
            server_search_opts = {'share_network_id': share_net_id}
            share_servs = manila.share_server_list(
                self.request,
                search_opts=server_search_opts)
            share_net.share_servers = share_servs
----------------------------------------------------------------------

it works fine for admin user, but failed with non-admin user, because manila.share_server_list() function(also shell command: manila share-server-list) can only be called by user with admin rights, so it reports 403 Access Denied in the back end, this is the root cause of this issue.
I tried this solution : add try ... except ... while calling manila.share_server_list().
But this is not good as the share server of this network can't be displayed on the ui.
Please check this issue and find a proper solution for it.

Revision history for this message
Lei Xiao (leix9999) wrote :
Changed in manila-ui:
assignee: nobody → NidhiMittalHada (nidhimittal19)
Changed in manila-ui:
assignee: NidhiMittalHada (nidhimittal19) → nobody
Changed in manila-ui:
status: New → Triaged
importance: Undecided → Medium
Changed in manila-ui:
assignee: nobody → Victoria Martinez de la Cruz (vkmc)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila-ui (master)

Fix proposed to branch: master
Review: https://review.openstack.org/649184

Changed in manila-ui:
assignee: Victoria Martinez de la Cruz (vkmc) → Tom Barron (tpb)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/649480

Changed in manila-ui:
assignee: Tom Barron (tpb) → Goutham Pacha Ravi (gouthamr)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila-ui (master)

Reviewed: https://review.openstack.org/649184
Committed: https://git.openstack.org/cgit/openstack/manila-ui/commit/?id=070fd98e7d67c5cd73a23b293167723dfbfeb9e5
Submitter: Zuul
Branch: master

commit 070fd98e7d67c5cd73a23b293167723dfbfeb9e5
Author: Tom Barron <email address hidden>
Date: Mon Apr 1 16:21:23 2019 -0400

    Show share network details to non-admin

    Horizon attempts to show associated share servers when displaying
    share network details in the project share-networks dashboard. But
    unless the horizon user is an admin this generates a 403 exception
    which in turn causes Horizon to pop-up an error message about being
    unable to retrieve share network details.

    So instead catch exceptions collecting share server information in
    this context and continue on gracefully, presenting the share server
    details that are available.

    Change-Id: I822ba95dc8e41df2775f908c287565f5da6a7e9d
    Closes-Bug: #1702396

Changed in manila-ui:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/649480
Committed: https://git.openstack.org/cgit/openstack/manila-ui/commit/?id=c8723091ed7f6ce19511f3ab666b2d7757557b2c
Submitter: Zuul
Branch: master

commit c8723091ed7f6ce19511f3ab666b2d7757557b2c
Author: Goutham Pacha Ravi <email address hidden>
Date: Tue Apr 2 16:53:49 2019 -0700

    Add share servers to share network detail

    We're missing share servers in the network
    detailed view. Also, it's not helpful to
    show either Share Servers or Security Services
    when none exist (or are not retrievable).

    Change-Id: Iacb8145f7865d73c479130cbe94078b4cc5c831a
    Partial-Bug: #1702396

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila-ui (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/650128

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/650131

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila-ui 2.18.0

This issue was fixed in the openstack/manila-ui 2.18.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila-ui (stable/rocky)

Reviewed: https://review.openstack.org/650128
Committed: https://git.openstack.org/cgit/openstack/manila-ui/commit/?id=4b56a868d7b30164b1c290929d89d23e4f98ca14
Submitter: Zuul
Branch: stable/rocky

commit 4b56a868d7b30164b1c290929d89d23e4f98ca14
Author: Goutham Pacha Ravi <email address hidden>
Date: Tue Apr 2 16:53:49 2019 -0700

    Add share servers to share network detail

    We're missing share servers in the network
    detailed view. Also, it's not helpful to
    show either Share Servers or Security Services
    when none exist (or are not retrievable).

    Change-Id: Iacb8145f7865d73c479130cbe94078b4cc5c831a
    Partial-Bug: #1702396
    (cherry picked from commit c8723091ed7f6ce19511f3ab666b2d7757557b2c)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/650131
Committed: https://git.openstack.org/cgit/openstack/manila-ui/commit/?id=68dab30b12860c62fb21dcdd04fab98788890532
Submitter: Zuul
Branch: stable/rocky

commit 68dab30b12860c62fb21dcdd04fab98788890532
Author: Tom Barron <email address hidden>
Date: Mon Apr 1 16:21:23 2019 -0400

    Show share network details to non-admin

    Horizon attempts to show associated share servers when displaying
    share network details in the project share-networks dashboard. But
    unless the horizon user is an admin this generates a 403 exception
    which in turn causes Horizon to pop-up an error message about being
    unable to retrieve share network details.

    So instead catch exceptions collecting share server information in
    this context and continue on gracefully, presenting the share server
    details that are available.

    Change-Id: I822ba95dc8e41df2775f908c287565f5da6a7e9d
    Closes-Bug: #1702396
    (cherry picked from commit 070fd98e7d67c5cd73a23b293167723dfbfeb9e5)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila-ui (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/651535

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/651540

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila-ui (stable/queens)

Reviewed: https://review.openstack.org/651540
Committed: https://git.openstack.org/cgit/openstack/manila-ui/commit/?id=a8e4f4fbef9b1c1fe6ee8601153e91d23f1ce5fe
Submitter: Zuul
Branch: stable/queens

commit a8e4f4fbef9b1c1fe6ee8601153e91d23f1ce5fe
Author: Goutham Pacha Ravi <email address hidden>
Date: Tue Apr 2 16:53:49 2019 -0700

    Add share servers to share network detail

    We're missing share servers in the network
    detailed view. Also, it's not helpful to
    show either Share Servers or Security Services
    when none exist (or are not retrievable).

    Change-Id: Iacb8145f7865d73c479130cbe94078b4cc5c831a
    Partial-Bug: #1702396
    (cherry picked from commit c8723091ed7f6ce19511f3ab666b2d7757557b2c)
    (cherry picked from commit 4b56a868d7b30164b1c290929d89d23e4f98ca14)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/651535
Committed: https://git.openstack.org/cgit/openstack/manila-ui/commit/?id=63122e0ecfe3930e5b01dcf0c283623977ef296c
Submitter: Zuul
Branch: stable/queens

commit 63122e0ecfe3930e5b01dcf0c283623977ef296c
Author: Tom Barron <email address hidden>
Date: Mon Apr 1 16:21:23 2019 -0400

    Show share network details to non-admin

    Horizon attempts to show associated share servers when displaying
    share network details in the project share-networks dashboard. But
    unless the horizon user is an admin this generates a 403 exception
    which in turn causes Horizon to pop-up an error message about being
    unable to retrieve share network details.

    So instead catch exceptions collecting share server information in
    this context and continue on gracefully, presenting the share server
    details that are available.

    Change-Id: I822ba95dc8e41df2775f908c287565f5da6a7e9d
    Closes-Bug: #1702396
    (cherry picked from commit 070fd98e7d67c5cd73a23b293167723dfbfeb9e5)
    (cherry picked from commit 68dab30b12860c62fb21dcdd04fab98788890532)

Changed in manila-ui:
milestone: none → train-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila-ui 2.13.1

This issue was fixed in the openstack/manila-ui 2.13.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila-ui 2.16.1

This issue was fixed in the openstack/manila-ui 2.16.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.