Skip to content

Commit 83bff4b

Browse files
authored
Merge pull request #13332 from sgayangi/sgayangi-webhook-transport-headerds
Add null check for user roles
2 parents 20d2825 + bd9936d commit 83bff4b

File tree

1 file changed

+9
-7
lines changed
  • components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils

1 file changed

+9
-7
lines changed

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7732,13 +7732,15 @@ private static String getActualEpPswdFromHiddenProperty(API api, Registry regist
77327732
public static boolean compareRoleList(String[] userRoleList, String accessControlRole) {
77337733
if (userRoleList != null) {
77347734
for (String userRole : userRoleList) {
7735-
if (Boolean.parseBoolean(caseSensitiveCheckEnabled)) {
7736-
if (userRole.equals(accessControlRole)) {
7737-
return true;
7738-
}
7739-
} else {
7740-
if (userRole.equalsIgnoreCase(accessControlRole)) {
7741-
return true;
7735+
if (userRole != null) {
7736+
if (Boolean.parseBoolean(caseSensitiveCheckEnabled)) {
7737+
if (userRole.equals(accessControlRole)) {
7738+
return true;
7739+
}
7740+
} else {
7741+
if (userRole.equalsIgnoreCase(accessControlRole)) {
7742+
return true;
7743+
}
77427744
}
77437745
}
77447746
}

0 commit comments

Comments
 (0)