Merge "Check project permissions for share replicas"

This commit is contained in:
Zuul 2022-05-06 04:31:14 +00:00 committed by Gerrit Code Review
commit 5611439891
2 changed files with 14 additions and 0 deletions

View File

@ -1862,6 +1862,12 @@ def _share_replica_get_with_filters(context, share_id=None, replica_id=None,
query = model_query(context, models.ShareInstance, session=session,
read_deleted="no")
if not context.is_admin:
query = query.join(
models.Share,
models.ShareInstance.share_id == models.Share.id).filter(
models.Share.project_id == context.project_id)
if share_id is not None:
query = query.filter(models.ShareInstance.share_id == share_id)

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Fixed an issue that caused Manila to return all projects' share replicas
even when the user was not an administrator. Now, when the user is not an
administrator, only the replicas in the project perspective are going to
be displayed. For more details, please refer to
`Launchpad Bug #1922243 <https://bugs.launchpad.net/manila/+bug/1922243>`_