Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chamilaadhi committed Sep 18, 2024
1 parent 034ca35 commit 134b2c0
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public PublisherAPI addAPI(Organization org, PublisherAPI publisherAPI) throws A
}

String visibleOrgs = APIConstants.DEFAULT_VISIBLE_ORG;
if (APIConstants.API_RESTRICTED_BY_ORG.equals(api.getVisibility())){
if (!StringUtils.isEmpty(api.getVisibleOrganizations())) {
visibleOrgs = api.getVisibleOrganizations();
}

Expand Down Expand Up @@ -554,9 +554,10 @@ public PublisherAPI updateAPI(Organization org, PublisherAPI publisherAPI) throw
String publisherAccessControlRoles = api.getAccessControlRoles();

String visibleOrgs = APIConstants.DEFAULT_VISIBLE_ORG;
if (APIConstants.API_RESTRICTED_BY_ORG.equals(api.getVisibility())){
if (!StringUtils.isEmpty(api.getVisibleOrganizations())) {
visibleOrgs = api.getVisibleOrganizations();
}

updateRegistryResources(registry, artifactPath, publisherAccessControlRoles, api.getAccessControl(),
api.getAdditionalProperties(), visibleOrgs);

Expand Down Expand Up @@ -3340,9 +3341,9 @@ public PublisherAPIProduct addAPIProduct(Organization org, PublisherAPIProduct p

String publisherAccessControlRoles = apiProduct.getAccessControlRoles();
String visibleOrgs = APIConstants.DEFAULT_VISIBLE_ORG;
if (APIConstants.API_RESTRICTED_BY_ORG.equals(apiProduct.getVisibility())){
// if (StringUtils.isEmpty(apiProduct.getVisibleOrganizations())) {
//visibleOrgs = apiProduct.getVisibleOrganizations(); TODO fix for products
}
// }
updateRegistryResources(registry, artifactPath, publisherAccessControlRoles, apiProduct.getAccessControl(),
apiProduct.getAdditionalProperties(), visibleOrgs);
RegistryPersistenceUtil.setResourcePermissions(apiProduct.getId().getProviderName(),
Expand Down Expand Up @@ -3570,9 +3571,9 @@ public PublisherAPIProduct updateAPIProduct(Organization org, PublisherAPIProduc
String publisherAccessControlRoles = apiProduct.getAccessControlRoles();

String visibleOrgs = APIConstants.DEFAULT_VISIBLE_ORG;
if (APIConstants.API_RESTRICTED_BY_ORG.equals(apiProduct.getVisibility())){
// if (APIConstants.API_RESTRICTED_BY_ORG.equals(apiProduct.getVisibility())){
//visibleOrgs = apiProduct.getVisibleOrganizations(); TODO fix for products
}
// }
updateRegistryResources(registry, artifactPath, publisherAccessControlRoles, apiProduct.getAccessControl(),
apiProduct.getAdditionalProperties(), visibleOrgs);
RegistryPersistenceUtil.setResourcePermissions(apiProduct.getId().getProviderName(),
Expand Down

0 comments on commit 134b2c0

Please sign in to comment.