summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
079a007)
Added fix for string comparison reported in sonarqube
Issue-ID: DMAAP-741
Change-Id: Iea73bbaeb1dc7d8fdecf3243dc122dbfbb3b97b9
Signed-off-by: Chandan Ghosh <cghosh12@in.ibm.com>
private boolean allowFeedsCollectionAccess(AuthzResource resource, String method, String subject, String subjectgroup) {
// Allow GET or POST unconditionally
private boolean allowFeedsCollectionAccess(AuthzResource resource, String method, String subject, String subjectgroup) {
// Allow GET or POST unconditionally
- return method != null && (method.equalsIgnoreCase("GET") || method.equalsIgnoreCase("POST"));
+ return method != null && ("GET".equalsIgnoreCase(method) || "POST".equalsIgnoreCase(method));
}
private boolean allowSubsCollectionAccess(AuthzResource resource, String method, String subject, String subjectgroup) {
// Allow GET or POST unconditionally
}
private boolean allowSubsCollectionAccess(AuthzResource resource, String method, String subject, String subjectgroup) {
// Allow GET or POST unconditionally
- return method != null && (method.equalsIgnoreCase("GET") || method.equalsIgnoreCase("POST"));
+ return method != null && ("GET".equalsIgnoreCase(method) || "POST".equalsIgnoreCase(method));
}
private boolean allowFeedAccess(AuthzResource resource, String method, String subject, String subjectgroup) {
boolean decision = false;
// Allow GET, PUT, or DELETE if requester (subject) is the owner (publisher) of the feed
}
private boolean allowFeedAccess(AuthzResource resource, String method, String subject, String subjectgroup) {
boolean decision = false;
// Allow GET, PUT, or DELETE if requester (subject) is the owner (publisher) of the feed
- if ( method != null && (method.equalsIgnoreCase("GET") || method.equalsIgnoreCase("PUT") ||
- method.equalsIgnoreCase("DELETE"))) {
+ if ( method != null && ("GET".equalsIgnoreCase(method) || "PUT".equalsIgnoreCase(method) ||
+ "DELETE".equalsIgnoreCase(method))) {
String owner = provData.getFeedOwner(resource.getId());
decision = (owner != null) && owner.equals(subject);
String owner = provData.getFeedOwner(resource.getId());
decision = (owner != null) && owner.equals(subject);
boolean decision = false;
// Allow GET, PUT, or DELETE if requester (subject) is the owner of the subscription (subscriber)
boolean decision = false;
// Allow GET, PUT, or DELETE if requester (subject) is the owner of the subscription (subscriber)
- if (method != null && (method.equalsIgnoreCase("GET") || method.equalsIgnoreCase("PUT") ||
- method.equalsIgnoreCase("DELETE") || method.equalsIgnoreCase("POST"))) {
+ if (method != null && ("GET".equalsIgnoreCase(method) || "PUT".equalsIgnoreCase(method) ||
+ "DELETE".equalsIgnoreCase(method) || "POST".equalsIgnoreCase(method))) {
String owner = provData.getSubscriptionOwner(resource.getId());
decision = (owner != null) && owner.equals(subject);
String owner = provData.getSubscriptionOwner(resource.getId());
decision = (owner != null) && owner.equals(subject);