-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement organization support in unified search and fix bugs identified via integration tests #12717
base: org_visibility
Are you sure you want to change the base?
Conversation
...carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/APIConstants.java
Outdated
Show resolved
Hide resolved
bdca0eb
to
134262e
Compare
@@ -4200,13 +4225,6 @@ public Map<String, Object> searchPaginatedContent(String searchQuery, String org | |||
List<APIDefinitionContentSearchResult> defSearchList = new ArrayList<>(); | |||
int totalLength = 0; | |||
|
|||
String userame = (userNameWithoutChange != null) ? userNameWithoutChange : username; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have to remove this section? maybe we could keep this code unchanged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That code block is not removed. Instead preserved the previous logic as it is and introduced a separate function for org visibility enabled flow
String artifactPath = GovernanceUtils.getArtifactPath(registry, apiId); | ||
|
||
//get API | ||
Resource apiResource = registry.get(artifactPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this method, we do couple of registry get actions to get the API's organization. I think we could pass the organization visibility from the method calling location instead of doing multiple registry calls. For example, API artifact is already retrieved in https://github.com/wso2/carbon-apimgt/pull/12717/files#diff-e193f41af36b63c9f226e35c981eeae30ee45850c880876c502785b547dbe00cR2635. you could get the organization information there and pass it to this method
devportalFilterQueryField = VISIBLE_ORGANIZATIONS; | ||
devportalFilterQuery = keyVal[1]; | ||
} else { | ||
devportalFilterQuery += (" AND visible_organizations_ss:" + keyVal[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets use constants here.
Fixes wso2/api-manager#3406