added fix while adding record to group
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@152486 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0c8e25c2e1
commit
7da90e6aa6
|
@ -373,7 +373,7 @@ public class GrsfPublisherStockService {
|
||||||
@Path("update-product")
|
@Path("update-product")
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public Response updateFishery(
|
public Response updateStock(
|
||||||
@NotNull(message="record cannot be null")
|
@NotNull(message="record cannot be null")
|
||||||
@Valid StockRecord record,
|
@Valid StockRecord record,
|
||||||
@PathParam("source") String source)
|
@PathParam("source") String source)
|
||||||
|
|
|
@ -69,17 +69,20 @@ public class AssociationToGroupThread extends Thread {
|
||||||
role = RolesCkanGroupOrOrg.MEMBER; // decrease the role to member if it is not an admin
|
role = RolesCkanGroupOrOrg.MEMBER; // decrease the role to member if it is not an admin
|
||||||
|
|
||||||
for (String groupTitle : uniqueGroups) {
|
for (String groupTitle : uniqueGroups) {
|
||||||
|
try{
|
||||||
|
logger.debug("Setting role " + role + " into group " + groupTitle + " to user " + username);
|
||||||
|
boolean assigned = catalogue.checkRoleIntoGroup(username, groupTitle, role);
|
||||||
|
|
||||||
logger.debug("Setting role " + role + " into group " + groupTitle + " to user " + username);
|
if(!assigned){
|
||||||
boolean assigned = catalogue.checkRoleIntoGroup(username, groupTitle, role);
|
logger.warn("The user " + username + " has not enough privileges to associate the dataset into group OR the group " + groupTitle + " doesn't exist ");
|
||||||
|
continue;
|
||||||
if(!assigned){
|
}
|
||||||
logger.warn("The user " + username + " has not enough privileges to associate the dataset into group OR the group " + groupTitle + " doesn't exist ");
|
else{
|
||||||
continue;
|
boolean putIntoGroup = catalogue.assignDatasetToGroup(groupTitle, datasetId, apiKey);
|
||||||
}
|
logger.info("Was product put into group " + groupTitle + "? " + putIntoGroup);
|
||||||
else{
|
}
|
||||||
boolean putIntoGroup = catalogue.assignDatasetToGroup(groupTitle, datasetId, apiKey);
|
}catch(Exception e){
|
||||||
logger.info("Was product put into group " + groupTitle + "? " + putIntoGroup);
|
logger.error("Something failed while adding product to group " + groupTitle, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info("The Association Group thread ended correctly");
|
logger.info("The Association Group thread ended correctly");
|
||||||
|
|
Loading…
Reference in New Issue