Skip to content

Commit

Permalink
Improve domain qualified username handling when filter users by group…
Browse files Browse the repository at this point in the history
… with PRIMARY domain
  • Loading branch information
sadilchamishka committed Jan 8, 2025
1 parent c457f30 commit 1d403f7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2024, WSO2 LLC. (http://www.wso2.com).
* Copyright (c) 2017-2025, WSO2 LLC. (http://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down Expand Up @@ -1791,7 +1791,10 @@ private int getUserCountByGroup(Node node, String domainName)
If there is a domain and if the domain separator is not found in the attribute value, append the domain
with the domain separator in front of the new attribute value.
*/
attributeValue = UserCoreUtil.addDomainToName(((ExpressionNode) node).getValue(), domainName);
if (StringUtils.isNotEmpty(domainName) && StringUtils
.containsNone(attributeValue, CarbonConstants.DOMAIN_SEPARATOR)) {
attributeValue = domainName.toUpperCase() + CarbonConstants.DOMAIN_SEPARATOR + attributeValue;
}

try {
List<String> roleNames = getRoleNames(attributeName, filterOperation, attributeValue);
Expand Down

0 comments on commit 1d403f7

Please sign in to comment.