Add granular permissions for the Image, Snapshot, Volume entities.

AWS Cloud Image:
View any AWS Cloud Image
View own AWS Cloud Image
Edit any AWS Cloud Image
Edit own AWS Cloud Image

AWS Cloud Volume:
View any AWS Cloud Volume
View own AWS Cloud Volume
Edit any AWS Cloud Volume
Edit own AWS Cloud Volume

AWS Cloud Snapshot:
View any AWS Cloud Snapshot
View own AWS Cloud Snapshot
Edit any AWS Cloud Snapshot
Edit own AWS Cloud Snapshot

Comments

baldwinlouie created an issue. See original summary.

baldwinlouie’s picture

Status: Active » Needs review
StatusFileSize
new49.25 KB

Adding patch with this functionality. In addition, I performed the following:

1. Add support in \Drupal\cloud\Controller\CloudConfigController::access for AND and OR permission combinations. This is needed because some urls such as entity.*.list_update should work for both "edit any aws cloud *" and "edit own aws cloud*"
2. Changed the visibility field in Image entity from varchar to boolean. The value coming from aws is a boolean field, so this matches it up.
3. For Volume permissions, if a volume is not assigned with Drupal UID, I try to derive it from the instance its attached to. This is because a volume is usually created when you launch an instance. The volume *technically* belongs to that instance, so it should take the instance's Drupal UID.

Status: Needs review » Needs work

The last submitted patch, 2: 3041538.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

baldwinlouie’s picture

Status: Needs work » Needs review
StatusFileSize
new56.1 KB

updating patch with unit test fixes.

baldwinlouie’s picture

StatusFileSize
new56.46 KB

updating.

Status: Needs review » Needs work

The last submitted patch, 5: 3041538-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

baldwinlouie’s picture

Status: Needs work » Needs review
StatusFileSize
new58.68 KB

Fixing the test case.

baldwinlouie’s picture

StatusFileSize
new73.12 KB

updating with coder fixes.

yas’s picture

@baldwinlouie

Thank you for providing the patch. It looks good to me.

@xiaohua-guan
@masami

What do you think?

baldwinlouie’s picture

StatusFileSize
new73.12 KB

new patch for coder fixes.

baldwinlouie’s picture

StatusFileSize
new73.19 KB

removing last two coder errors.

xiaohua guan’s picture

@baldwinlouie @yas

Thanks for the great patch! It looks OK to me!

masami’s picture

Status: Needs review » Reviewed & tested by the community

@baldwinlouie
@yas
I think it good. So I changed the status to RTBC.

yas’s picture

@xiaohua-guan
@masami

Thank you for your review. I'll merge the patch and close this issue as Fixed.

  • yas committed 683e05f on 8.x-1.x authored by baldwinlouie
    Issue #3041538 by baldwinlouie, yas, Xiaohua Guan, Masami: Add granular...
yas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.