Skip to content

Commit

Permalink
Merge pull request #447 from wso2/revert-439-master
Browse files Browse the repository at this point in the history
Revert "Fix tenant API product disappearance issue after setting DevPortal visibility by roles in Publisher Portal"
  • Loading branch information
chamilaadhi authored Jan 3, 2025
2 parents b62a799 + bc0f56c commit 3d47ac1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.wso2.carbon.registry.indexing.solr.SolrClient;
import org.wso2.carbon.user.core.UserRealm;
import org.wso2.carbon.user.core.UserStoreException;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;

import java.util.*;

Expand Down Expand Up @@ -304,7 +303,7 @@ private boolean isAuthorized(UserRegistry registry, String resourcePath, String
String userName = getLoggedInUserName();

try {
if (!userRealm.getAuthorizationManager().isUserAuthorized(MultitenantUtils.getTenantAwareUsername(userName),
if (!userRealm.getAuthorizationManager().isUserAuthorized(userName,
resourcePath, action)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import org.wso2.carbon.user.api.UserRealm;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.utils.CarbonUtils;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;

import java.io.File;
import java.io.FileOutputStream;
Expand Down Expand Up @@ -786,7 +785,7 @@ private void addUserRoleFilter(int tenantId, SolrQuery query) throws SolrExcepti
userName = CarbonConstants.REGISTRY_ANONNYMOUS_USERNAME;
}

String[] userRoles = realm.getUserStoreManager().getRoleListOfUser(MultitenantUtils.getTenantAwareUsername(userName));
String[] userRoles = realm.getUserStoreManager().getRoleListOfUser(userName);

if (skipRolesByRegex != null) {
List<String> filteredUserRoles = new ArrayList<>(Arrays.asList(userRoles));
Expand Down

0 comments on commit 3d47ac1

Please sign in to comment.