WIP. Authorities upd

This commit is contained in:
echerniak 2021-11-23 18:34:27 +03:00
parent f8137374d5
commit 7442e7a391
No known key found for this signature in database
GPG Key ID: 7D79B3A9CB749B36
3 changed files with 9 additions and 3 deletions

View File

@ -18,7 +18,7 @@ import java.util.List;
import static com.rbkmoney.anapi.v2.util.DeadlineUtil.checkDeadline;
@Service
@PreAuthorize("hasAuthority('invoices:read')")
@PreAuthorize("hasAuthority('party:read')")
@RequiredArgsConstructor
@Slf4j
@SuppressWarnings({"ParameterName", "LineLength"})

View File

@ -27,6 +27,7 @@ import static com.rbkmoney.anapi.v2.util.DeadlineUtil.checkDeadline;
@Service
@RequiredArgsConstructor
@Slf4j
@SuppressWarnings({"ParameterName"})
public class ReportsApiDelegateService implements ReportsApiDelegate {
private final AccessService accessService;

View File

@ -17,10 +17,9 @@ import static com.rbkmoney.anapi.v2.util.ConverterUtil.merge;
import static com.rbkmoney.anapi.v2.util.DeadlineUtil.checkDeadline;
@Service
@PreAuthorize("hasAuthority('invoices:read')")
@RequiredArgsConstructor
@Slf4j
@SuppressWarnings({"ParameterName", "LineLength"})
@SuppressWarnings("ParameterName")
public class SearchApiDelegateService implements SearchApiDelegate {
private final MagistaService magistaService;
@ -32,6 +31,7 @@ public class SearchApiDelegateService implements SearchApiDelegate {
private final ParamsToPayoutSearchQueryConverter payoutSearchConverter;
private final ParamsToInvoiceTemplateSearchQueryConverter invoiceTemplateSearchConverter;
@PreAuthorize("hasAuthority('invoices:read')")
@Override
public ResponseEntity<InlineResponse2008> searchInvoices(String xRequestID, String partyID, OffsetDateTime fromTime, OffsetDateTime toTime, Integer limit, String xRequestDeadline, String shopID, List<String> shopIDs, String paymentInstitutionRealm, String invoiceID, List<String> invoiceIDs, String invoiceStatus, Long invoiceAmountFrom, Long invoiceAmountTo, String externalID, String continuationToken) {
log.info("-> Req: xRequestID={}", xRequestID);
@ -59,6 +59,7 @@ public class SearchApiDelegateService implements SearchApiDelegate {
return ResponseEntity.ok(response);
}
@PreAuthorize("hasAuthority('invoices:read') and hasAuthority('payments:read')")
@Override
public ResponseEntity<InlineResponse2009> searchPayments(String xRequestID, String partyID, OffsetDateTime fromTime, OffsetDateTime toTime, Integer limit, String xRequestDeadline, String shopID, List<String> shopIDs, List<String> excludeShopIDs, String paymentInstitutionRealm, String invoiceID, List<String> invoiceIDs, String paymentID, String paymentStatus, String paymentFlow, String paymentMethod, String paymentTerminalProvider, String payerEmail, String payerIP, String payerFingerprint, String customerID, String first6, String last4, String rrn, String approvalCode, String bankCardTokenProvider, String bankCardPaymentSystem, Long paymentAmountFrom, Long paymentAmountTo, String externalID, String continuationToken) {
log.info("-> Req: xRequestID={}", xRequestID);
@ -100,6 +101,7 @@ public class SearchApiDelegateService implements SearchApiDelegate {
return ResponseEntity.ok(response);
}
@PreAuthorize("hasAuthority('invoices:read') and hasAuthority('payments:read')")
@Override
public ResponseEntity<InlineResponse20010> searchRefunds(String xRequestID, String partyID, OffsetDateTime fromTime, OffsetDateTime toTime, Integer limit, String xRequestDeadline, String shopID, List<String> shopIDs, String paymentInstitutionRealm, String invoiceID, List<String> invoiceIDs, String paymentID, String refundID, String refundStatus, String externalID, String continuationToken) {
log.info("-> Req: xRequestID={}", xRequestID);
@ -127,6 +129,7 @@ public class SearchApiDelegateService implements SearchApiDelegate {
return ResponseEntity.ok(response);
}
@PreAuthorize("hasAuthority('party:read')")
@Override
public ResponseEntity<InlineResponse20011> searchChargebacks(String xRequestID, String partyID, OffsetDateTime fromTime, OffsetDateTime toTime, Integer limit, String xRequestDeadline, String shopID, List<String> shopIDs, String paymentInstitutionRealm, String invoiceID, String paymentID, String chargebackID, List<String> chargebackStatuses, List<String> chargebackStages, List<String> chargebackCategories, String continuationToken) {
log.info("-> Req: xRequestID={}", xRequestID);
@ -154,6 +157,7 @@ public class SearchApiDelegateService implements SearchApiDelegate {
return ResponseEntity.ok(response);
}
@PreAuthorize("hasAuthority('party:read')")
@Override
public ResponseEntity<InlineResponse20012> searchPayouts(String xRequestID, String partyID, OffsetDateTime fromTime, OffsetDateTime toTime, Integer limit, String xRequestDeadline, String shopID, List<String> shopIDs, String paymentInstitutionRealm, String payoutID, String payoutToolType, String continuationToken) {
log.info("-> Req: xRequestID={}", xRequestID);
@ -177,6 +181,7 @@ public class SearchApiDelegateService implements SearchApiDelegate {
return ResponseEntity.ok(response);
}
@PreAuthorize("hasAuthority('invoices:read')")
@Override
public ResponseEntity<InlineResponse20013> searchInvoiceTemplates(String xRequestID, String partyID, OffsetDateTime fromTime, OffsetDateTime toTime, Integer limit, String xRequestDeadline, List<String> shopIDs, String paymentInstitutionRealm, String invoiceTemplateID, String invoiceTemplateStatus, String name, String product, OffsetDateTime invoiceValidUntil, String continuationToken) {
log.info("-> Req: xRequestID={}", xRequestID);