Skip to content

Commit 3cbb128

Browse files
authored
Merge pull request guardian#4317 from bbc/conal/IMAGEDAM-1830-restrictPhotoSalesFunctionality
IMAEGEDAM-1830: showPaid permission prevents standard users from accessing sendToPhotosales functionality
2 parents c2473bb + 0b798ae commit 3cbb128

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

kahuna/public/js/search/results.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
<div class="results-toolbar-item results-toolbar-item--right"
8585
tabindex="0"
86-
ng-if="ctrl.showSendToPhotoSales()">
86+
ng-if="ctrl.showSendToPhotoSales() && ctrl.showPaid">
8787
<a id="send-to"
8888
style="display: contents;"
8989
ng-class="{'batch-archive__button--disabled': ctrl.selectionCount >= 45}"

kahuna/public/js/search/results.js

+5
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,11 @@ results.controller('SearchResultsCtrl', [
419419
return [validImages, invalidImages];
420420
};
421421

422+
ctrl.showPaid = undefined;
423+
mediaApi.getSession().then(session => {
424+
ctrl.showPaid = session.user.permissions.showPaid ? session.user.permissions.showPaid : undefined;
425+
});
426+
422427
ctrl.sendToPhotoSales = () => {
423428
try {
424429
const validImages = validatePhotoSalesSelection(ctrl.selectedImages)[0];

0 commit comments

Comments
 (0)