Unable to retrieve replica details as non-admin user

Bug #1787016 reported by Goutham Pacha Ravi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Medium
Goutham Pacha Ravi
manila-ui
Fix Released
Medium
Goutham Pacha Ravi

Bug Description

How to reproduce:

0) Setup manila with a driver that supports replication (ex: zfsonlinux driver, or just the dummy driver for testing)
1) As admin, create a share type that supports replication, set appropriate replication_type extra spec (replication_type = "readable" for dummy and zfsonlinux drivers)
2) Log into UI as non-admin user, create a share of the type created above
3) Create a share replica (Drop down on the share you created in #2, click "Manage Replicas"->"Create Replica")
4) Click on share replica to retrieve its details

Expected Results:
- See the details of the replica, ex: export location needed to mount the replica

Actual Results:
- An error banner pops up, redirecting the user to the last page, See attached screenshot

Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :
Changed in manila-ui:
status: New → Triaged
Changed in manila-ui:
assignee: nobody → Goutham Pacha Ravi (gouthamr)
importance: Undecided → Medium
milestone: none → stein-1
Changed in manila:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Goutham Pacha Ravi (gouthamr)
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

The UI uses an API (GET /v2/{tenant_id}/share_instances/{share_instance_id}/export_locations) that has default policy set to "admin"; we don't/shouldn't expect cloud administrators to relax this policy for users to see per-replica export locations. Manila needs a way to expose share replica export locations to end users.

https://developer.openstack.org/api-ref/shared-file-system/#id302

Tom Barron (tpb)
Changed in manila-ui:
milestone: stein-1 → train-1
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

Manila exposes, with API 2.47, an export locations API that has its default policy set such that non-privileged tenants may access it [1]

The manila client SDK supports this feature too, in version 1.27.x of the library [2]

[1] https://developer.openstack.org/api-ref/shared-file-system/#share-replica-export-locations-since-api-v2-47
[2] https://docs.openstack.org/releasenotes/python-manilaclient/stein.html#relnotes-1-27-0-stable-stein

Changed in manila:
milestone: none → train-1
milestone: train-1 → stein-3
status: Triaged → Fix Released
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/649702

Changed in manila-ui:
status: Triaged → In Progress
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

https://review.openstack.org/649702 is only a partial fix that we can back port to stable releases. please follow https://bugs.launchpad.net/manila-ui/+bug/1823078 which blocks using a tenant visible export locations API for non-privileged project users to retrieve export locations of individual share replicas.

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

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

commit 8aa099315403381c5c3bb32415d5ba5d8e518a4d
Author: Goutham Pacha Ravi <email address hidden>
Date: Wed Apr 3 12:18:19 2019 -0700

    Fix share replica details page for non-admins

    Non-administrators cannot access share instance
    export locations by the virtue of default policy.

    Fix this retrieval to not error-out showing the
    whole page.

    Change-Id: I5f78e7fbfbf4ce93f9c1658609f20f179c6995a6
    Closes-Bug: #1787016

Changed in manila-ui:
status: In Progress → Fix Released
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/650130

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/650130
Committed: https://git.openstack.org/cgit/openstack/manila-ui/commit/?id=4ce060cf725210e895c7b1567c1c6a4928db44ee
Submitter: Zuul
Branch: stable/rocky

commit 4ce060cf725210e895c7b1567c1c6a4928db44ee
Author: Goutham Pacha Ravi <email address hidden>
Date: Wed Apr 3 12:18:19 2019 -0700

    Fix share replica details page for non-admins

    Non-administrators cannot access share instance
    export locations by the virtue of default policy.

    Fix this retrieval to not error-out showing the
    whole page.

    Change-Id: I5f78e7fbfbf4ce93f9c1658609f20f179c6995a6
    Closes-Bug: #1787016
    (cherry picked from commit 8aa099315403381c5c3bb32415d5ba5d8e518a4d)

tags: added: in-stable-rocky
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/651536

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

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

commit 517266b37c8c73daeff8ee785c2134fb9d179578
Author: Goutham Pacha Ravi <email address hidden>
Date: Wed Apr 3 12:18:19 2019 -0700

    Fix share replica details page for non-admins

    Non-administrators cannot access share instance
    export locations by the virtue of default policy.

    Fix this retrieval to not error-out showing the
    whole page.

    Change-Id: I5f78e7fbfbf4ce93f9c1658609f20f179c6995a6
    Closes-Bug: #1787016
    (cherry picked from commit 8aa099315403381c5c3bb32415d5ba5d8e518a4d)
    (cherry picked from commit 4ce060cf725210e895c7b1567c1c6a4928db44ee)

tags: added: in-stable-queens
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.