@RequiresPermissions(Permission.PAYMENT_CAN_REFUND) public void createRefund(); }
public void assertAuthorized(final Annotation annotation) throws AuthorizationException { if (!(annotation instanceof RequiresPermissions)) { return; } final RequiresPermissions requiresPermissions = (RequiresPermissions) annotation; try { securityApi.checkCurrentUserPermissions(ImmutableList.<Permission>copyOf(requiresPermissions.value()), requiresPermissions.logical(), context); } catch (SecurityApiException e) { if (e.getCause() != null && e.getCause() instanceof AuthorizationException) { throw (AuthorizationException) e.getCause(); } else if (e.getCause() != null) { throw new AuthorizationException(e.getCause()); } else { throw new AuthorizationException(e); } } } }
@RequiresPermissions(Permission.PAYMENT_CAN_REFUND) public void createRefund() {} }
public void assertAuthorized(final Annotation annotation) throws AuthorizationException { if (!(annotation instanceof RequiresPermissions)) { return; } final RequiresPermissions requiresPermissions = (RequiresPermissions) annotation; try { securityApi.checkCurrentUserPermissions(ImmutableList.<Permission>copyOf(requiresPermissions.value()), requiresPermissions.logical(), context); } catch (SecurityApiException e) { if (e.getCause() != null && e.getCause() instanceof AuthorizationException) { throw (AuthorizationException) e.getCause(); } else if (e.getCause() != null) { throw new AuthorizationException(e.getCause()); } else { throw new AuthorizationException(e); } } } }
/** * @param accountId the account unique id * @param email the email to be removed * @param context the user context */ @RequiresPermissions(ACCOUNT_CAN_DELETE_EMAILS) public void removeEmail(UUID accountId, AccountEmail email, CallContext context);
/** * Delete a CBA item. * * @param accountId account id * @param invoiceId invoice id * @param invoiceItemId invoice item id (must be of type CBA_ADJ) * @param context the call context * @throws InvoiceApiException */ @RequiresPermissions(INVOICE_CAN_DELETE_CBA) public void deleteCBA(UUID accountId, UUID invoiceId, UUID invoiceItemId, CallContext context) throws InvoiceApiException;
/** * @param bcd the new BCD for that subscription * @param effectiveFromDate date after which that BCD change becomes active * @param context the context * @throws EntitlementApiException */ @RequiresPermissions(ENTITLEMENT_CAN_CREATE) public void updateBCD(final int bcd, final LocalDate effectiveFromDate, final CallContext context) throws EntitlementApiException;
/** * @param tagDefinitionId The UUID for that tagDefinition * @param context The call context, for auditing purposes * @throws TagDefinitionApiException */ @RequiresPermissions(TAG_CAN_DELETE_TAG_DEFINITION) public void deleteTagDefinition(UUID tagDefinitionId, CallContext context) throws TagDefinitionApiException;
/** * @param objectId The id for the object on which to add tags * @param objectType The object type * @param tagDefinitions The collection of tag definition ids * @param context The call context, for auditing purposes * @throws TagApiException */ @RequiresPermissions(TAG_CAN_REMOVE) public void removeTags(UUID objectId, ObjectType objectType, Collection<UUID> tagDefinitions, CallContext context) throws TagApiException;
/** * Update the externalKey for a given bundle * * @param bundleId ; bundle id * @param newExternalKey : the new value for the externalKey * @param context : the call context */ @RequiresPermissions(ENTITLEMENT_CAN_CREATE) public void updateExternalKey(UUID bundleId, String newExternalKey, CallContext context) throws EntitlementApiException;
/** * Updates the account by specifying the {@code AccountData} object * <p/> * * @param key account external key * @param context contains specific information about the call * @throws AccountApiException if a failure occurs */ @RequiresPermissions(ACCOUNT_CAN_UPDATE) public void updateAccount(String key, AccountData accountData, CallContext context) throws AccountApiException;
/** * Updates the account by specifying the {@code AccountData} object * <p/> * * @param accountId account unique id * @param context contains specific information about the call * @throws AccountApiException if a failure occurs */ @RequiresPermissions(ACCOUNT_CAN_UPDATE) public void updateAccount(UUID accountId, AccountData accountData, CallContext context) throws AccountApiException;
/** * @param fields the list of fields to add * @param context the call context * @throws CustomFieldApiException */ @RequiresPermissions(CUSTOM_FIELDS_CAN_ADD) void addCustomFields(List<CustomField> fields, CallContext context) throws CustomFieldApiException;
/** * @param fields the list of fields to add * @param context the call context * @throws CustomFieldApiException */ @RequiresPermissions(CUSTOM_FIELDS_CAN_UPDATE) void updateCustomFields(List<CustomField> fields, CallContext context) throws CustomFieldApiException;
/** @param accountId account id * @param invoiceDate maximum billing event day to consider (in the account timezone) * @param items items to be placed on the migration invoice * @param context call call context * @return The UUID of the created invoice */ @RequiresPermissions(INVOICE_CAN_TRIGGER_INVOICE) public UUID createMigrationInvoice(UUID accountId, LocalDate invoiceDate, Iterable<InvoiceItem> items, CallContext context);
/** * @param context the context * @throws OverdueApiException */ @RequiresPermissions(OVERDUE_CAN_UPLOAD) void uploadOverdueConfig(String overdueXML, CallContext context) throws OverdueApiException;
/** * Cancel scheduled future payment retry * * @param paymentTransactionId the id identifying the transaction * @param context the call context * @throws PaymentApiException */ @RequiresPermissions(PAYMENT_CAN_TRIGGER_PAYMENT) public void cancelScheduledPaymentTransaction(UUID paymentTransactionId, CallContext context) throws PaymentApiException;
/** * Will pause all entitlements associated with the base entitlement. If there are no ADD_ONN this is only the base entitlement. * * @param bundleId * @param effectiveDate * @param properties plugin specific properties * @param context * @throws EntitlementApiException if the system fail to find the base <code>Entitlement</code> */ @RequiresPermissions(ENTITLEMENT_CAN_PAUSE_RESUME) public void pause(UUID bundleId, LocalDate effectiveDate, Iterable<PluginProperty> properties, CallContext context) throws EntitlementApiException;
/** * Trigger an invoice for a given account and a given day. * * @param accountId account id * @param targetDate the target day, in the account timezone * @param dryRunArguments dry run arguments * @param context the call context * @return the invoice generated * @throws InvoiceApiException */ @RequiresPermissions(INVOICE_CAN_DRY_RUN_INVOICE) public Invoice triggerDryRunInvoiceGeneration(UUID accountId, LocalDate targetDate, DryRunArguments dryRunArguments, CallContext context) throws InvoiceApiException;
/** * Bulk usage API when the external system (or the meter module) rolls-up usage data. * <p/> * * @param usage the usage for a given period of time associated with a subscription * @param context tenant context */ @RequiresPermissions(USAGE_CAN_RECORD) public void recordRolledUpUsage(SubscriptionUsageRecord usage, CallContext context) throws UsageApiException;