Fixed add to organization
This commit is contained in:
parent
7db232b970
commit
c227d5069d
|
@ -139,14 +139,10 @@ public class CKANPackage extends CKAN implements Moderated {
|
|||
PURGE = ITEM_PURGE;
|
||||
managedResources = new ArrayList<CKANResource>();
|
||||
|
||||
ckanUser = CKANUserCache.getCurrrentCKANUser();
|
||||
|
||||
configuration = CatalogueConfigurationFactory.getInstance();
|
||||
|
||||
for(String supportedOrganization : configuration.getSupportedOrganizations()) {
|
||||
ckanUser.addUserToOrganization(supportedOrganization);
|
||||
}
|
||||
|
||||
ckanUser = CKANUserCache.getCurrrentCKANUser();
|
||||
|
||||
}
|
||||
|
||||
protected CKANOrganization checkGotOrganization(String gotOrganization) throws ForbiddenException {
|
||||
|
|
|
@ -54,15 +54,9 @@ public class CKANPackageTrash {
|
|||
|
||||
public CKANPackageTrash() {
|
||||
mapper = new ObjectMapper();
|
||||
|
||||
ckanUser = CKANUserCache.getCurrrentCKANUser();
|
||||
configuration = CatalogueConfigurationFactory.getInstance();
|
||||
|
||||
supportedOrganizations = configuration.getSupportedOrganizations();
|
||||
for(String supportedOrganization : supportedOrganizations) {
|
||||
ckanUser.addUserToOrganization(supportedOrganization);
|
||||
}
|
||||
|
||||
ownOnly = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,10 @@ import javax.ws.rs.core.Response.Status;
|
|||
import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import org.gcube.common.authorization.utils.manager.SecretManagerProvider;
|
||||
import org.gcube.common.authorization.utils.user.User;
|
||||
import org.gcube.gcat.api.configuration.CatalogueConfiguration;
|
||||
import org.gcube.gcat.api.moderation.Moderated;
|
||||
import org.gcube.gcat.api.roles.Role;
|
||||
import org.gcube.gcat.configuration.CatalogueConfigurationFactory;
|
||||
import org.gcube.gcat.utils.RandomString;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -174,7 +176,10 @@ public class CKANUser extends CKAN {
|
|||
}
|
||||
}
|
||||
try {
|
||||
addUserToOrganization();
|
||||
CatalogueConfiguration configuration = CatalogueConfigurationFactory.getInstance();
|
||||
for(String supportedOrganization : configuration.getSupportedOrganizations()) {
|
||||
addUserToOrganization(supportedOrganization);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
// The organization could not exists and this is fine in some cases like organization create or
|
||||
// for listing items at VO level. The organization corresponding to the VO could not exists.
|
||||
|
|
Loading…
Reference in New Issue