Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove protected fields, in subclasses #169

Merged
merged 3 commits into from
Dec 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ public InterceptingConsentManager(ConsentManagerConfigurationHolder configHolder
public Receipt getReceipt(String receiptId) throws ConsentManagementException {

validateAuthorizationForGetOrRevokeReceipts(receiptId, GET_RECEIPT);
return consentManager.getReceipt(receiptId);
return super.getReceipt(receiptId);
}

public List<ReceiptListResponse> searchReceipts(int limit, int offset, String piiPrincipalId, String spTenantDomain,
String service, String state) throws ConsentManagementException {

validateAuthorizationForListReceipts(piiPrincipalId);
return consentManager.searchReceipts(limit, offset, piiPrincipalId, spTenantDomain, service, state);
return super.searchReceipts(limit, offset, piiPrincipalId, spTenantDomain, service, state);
}

public void revokeReceipt(String receiptId) throws ConsentManagementException {

validateAuthorizationForGetOrRevokeReceipts(receiptId, REVOKE_RECEIPT);
consentManager.revokeReceipt(receiptId);
super.revokeReceipt(receiptId);
}

private void validateAuthorizationForListReceipts(String piiPrincipalId) throws ConsentManagementException {
Expand Down Expand Up @@ -113,7 +113,7 @@ private void validateAuthorizationForGetOrRevokeReceipts(String receiptId, Strin
}
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();

if (consentManager.isReceiptExist(receiptId, loggedInUser, tenantId)) {
if (super.isReceiptExist(receiptId, loggedInUser, tenantId)) {
if (log.isDebugEnabled()) {
log.debug("User: " + loggedInUser + " is authorized to perform a " + operation + " on own " +
"consent receipt.");
Expand All @@ -131,7 +131,7 @@ private void validateAuthorizationForGetOrRevokeReceipts(String receiptId, Strin
private void handleCrossDomainPermission(String receiptId) throws ConsentManagementException {

String tenantDomain = ConsentUtils.getTenantDomainFromCarbonContext();
Receipt receipt = consentManager.getReceipt(receiptId);
Receipt receipt = super.getReceipt(receiptId);
if (receipt != null) {
if (StringUtils.equals(receipt.getTenantDomain(), tenantDomain)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
*/
public class PrivilegedConsentManagerImpl implements PrivilegedConsentManager {

protected ConsentManager consentManager;
private ConsentManager consentManager;
protected List<ConsentMgtInterceptor> consentMgtInterceptors;

public PrivilegedConsentManagerImpl(ConsentManagerConfigurationHolder configHolder,
Expand Down