diff --git a/components/apimgt/org.wso2.carbon.apimgt.tokenmgt/src/main/java/org/wso2/carbon/apimgt/tokenmgt/listeners/KeyManagerUserOperationListener.java b/components/apimgt/org.wso2.carbon.apimgt.tokenmgt/src/main/java/org/wso2/carbon/apimgt/tokenmgt/listeners/KeyManagerUserOperationListener.java index 033208a79812..05bdbdbc8f23 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.tokenmgt/src/main/java/org/wso2/carbon/apimgt/tokenmgt/listeners/KeyManagerUserOperationListener.java +++ b/components/apimgt/org.wso2.carbon.apimgt.tokenmgt/src/main/java/org/wso2/carbon/apimgt/tokenmgt/listeners/KeyManagerUserOperationListener.java @@ -176,6 +176,18 @@ public boolean doPreUpdateRoleListOfUser(String username, String[] deletedRoles, return true; } + @Override + public boolean doPreUpdateInternalRoleListOfUser(String userName, String[] deletedRoles, + String[] newRoles, + UserStoreManager userStoreManager) { + + if (!isEnable()) { + return true; + } + APIUtil.clearRoleCache(getUserName(userName, userStoreManager)); + return true; + } + @Override public boolean doPreUpdateUserListOfRole(String roleName, String[] deletedUsers, String[] newUsers, UserStoreManager userStoreManager) {