Adding the user to all supported organization instead of only to the

organization the item is going to be published.
This commit is contained in:
Luca Frosini 2020-06-23 13:17:58 +02:00
parent c7890e2121
commit ae173ccbd4
1 changed files with 6 additions and 2 deletions

View File

@ -175,6 +175,11 @@ public class CKANPackage extends CKAN {
}
CKANUser ckanUser = CKANUserCache.getCurrrentCKANUser();
for(String supportedOrganization : supportedOrganizations) {
ckanUser.addUserToOrganization(supportedOrganization);
}
logger.debug("Supported CKAN Organization for current Context ({}) are {}", getCurrentContext(),
supportedOrganizations);
return supportedOrganizations;
@ -286,8 +291,7 @@ public class CKANPackage extends CKAN {
objectNode.put(AUTHOR_KEY, ckanUser.getName());
objectNode.put(AUTHOR_EMAIL_KEY, ckanUser.getPortalUser().getEMail());
CKANOrganization ckanOrganization = getPublishingOrganization(objectNode);
ckanUser.addUserToOrganization(ckanOrganization.getName());
getPublishingOrganization(objectNode);
return objectNode;
}