guardian / grid

The Guardian’s image management system
https://www.theguardian.com/info/developer-blog/2015/aug/12/open-sourcing-grid-image-service
Apache License 2.0
1.44k stars 121 forks source link

IMAGEDAM-1982: Prevent the resend of capture images and restrict icons #4340

Closed Conalb97 closed 1 month ago

Conalb97 commented 2 months ago

What does this change?

This change prevents users from sending images that were received from Photo Sales back to Photo Sales - this is enabled through the same modal/notification mechanism that is already applied to images that have an 'Added to Photo Sales' usage. Additionally, the 'sales' icon (for BBC Photo Sales) will now also display for images received from Photo Sales, whereas before it was only present for images that were sent to Photo Sales. Finally it ensures that only archivist users will be able to see the sales icon, standard users will not be able to.

How should a reviewer test this change?

As a user with elevated permissions and with the showSendToPhotoSales flag set to true:

Users can not send images back to BBC Photo Sales:

The sales icon is present for images received from Photo Sales:

As a user without elevated permissions and with the showSendToPhotoSales flag set to true:

The sales icon is not present on any images:

Who should look at this?

Tested? Documented?

AndyKilmory commented 1 month ago

Looks good to me - but given the increased usage of the media API call to understand user permissions we must make sure that this value is cached at the session level and we don't repeatedly make calls to the server to get these data

prout-bot commented 1 month ago

Seen on auth, usage, image-loader, metadata-editor, thrall, leases, cropper, collections, media-api, kahuna (created by @Conalb97 and merged by @andrew-nowak 8 minutes and 34 seconds ago) Please check your changes!