Policy checks are skipped when looking up a share-type
by name. This causes share creation attempts that specify
a valid share-type to pass the early API check on share type
even if the share type named is private and not shared with
the user's project. The share creation fails later, but after
the database record for the share is created. Although the
operation fails with an ERROR, the share is stuck in CREATING
state.
Fix this issue by checking the user's project in the database
API just as we do for share type lookups by uuid.
Closes-bug: #1885956
Change-Id: If5fe32c155fe0861b3ed86b862335e062796056b
(cherry picked from commit f877deed5186cff3a7ecfbce2536e72fc6013895)
(cherry picked from commit e02cc6d6bc92e354bc7f4220a05ec6fedf2ecc9c)
(cherry picked from commit 2f2ed258f7c273543495b5476af2c3558d51384d)
(cherry picked from commit 644cdf4e4ff965cb96b8cce5396042b6ac8abe7e)
(cherry picked from commit 11971a94d3205b42ee9e2f7c9978b4bb979fdd71)
Reviewed: https:/ /review. opendev. org/743026 /git.openstack. org/cgit/ openstack/ manila/ commit/ ?id=9b1b3957b99 2baf68624d1b878 6949f4a4bc191a
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit 9b1b3957b992baf 68624d1b8786949 f4a4bc191a
Author: Tom Barron <email address hidden>
Date: Wed Jul 1 17:09:40 2020 -0400
Enforce policy checks getting share-type by name
Policy checks are skipped when looking up a share-type
by name. This causes share creation attempts that specify
a valid share-type to pass the early API check on share type
even if the share type named is private and not shared with
the user's project. The share creation fails later, but after
the database record for the share is created. Although the
operation fails with an ERROR, the share is stuck in CREATING
state.
Fix this issue by checking the user's project in the database
API just as we do for share type lookups by uuid.
Closes-bug: #1885956 61b3ed86b862335 e062796056b 3a7ecfbce2536e7 2fc6013895) 4bc7f4220a05ec6 fedf2ecc9c) 43495b5476af2c3 558d51384d) b96b8cce5396042 b6ac8abe7e) 2ee9e2f7c9978b4 bb979fdd71)
Change-Id: If5fe32c155fe08
(cherry picked from commit f877deed5186cff
(cherry picked from commit e02cc6d6bc92e35
(cherry picked from commit 2f2ed258f7c2735
(cherry picked from commit 644cdf4e4ff965c
(cherry picked from commit 11971a94d3205b4