added map for speeding up role extensions check
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@162598 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2f987757c3
commit
a86cf4b4bb
|
@ -50,6 +50,7 @@ public class CommonServiceUtils {
|
|||
|
||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(CommonServiceUtils.class);
|
||||
private static final int TAG_MAX_SIZE = 100;
|
||||
private static Map<String, Boolean> extensionsCheck = new HashMap<String, Boolean>();
|
||||
|
||||
/**
|
||||
* Retrieve the list of licenses for stocks and fisheries
|
||||
|
@ -278,7 +279,7 @@ public class CommonServiceUtils {
|
|||
extras.put(keyField, Arrays.asList(Constants.NO_SIMILAR_GRSF_RECORDS));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(source.equals(Sources.GRSF) && keyField.equals(Constants.CONNECTED_JSON_KEY)){
|
||||
|
@ -609,12 +610,15 @@ public class CommonServiceUtils {
|
|||
* @param organization
|
||||
* @param admin
|
||||
*/
|
||||
public static void extendRoleToOtherOrganizations(String username,
|
||||
DataCatalogue catalogue, String organization,
|
||||
RolesCkanGroupOrOrg admin) {
|
||||
public static void extendRoleToOtherOrganizations(String username, DataCatalogue catalogue, String organization, RolesCkanGroupOrOrg admin) {
|
||||
|
||||
logger.debug("Checking if role extension is needed here");
|
||||
catalogue.assignRolesOtherOrganization(username, organization, admin);
|
||||
if(extensionsCheck.containsKey(username) && extensionsCheck.get(username))
|
||||
return;
|
||||
else{
|
||||
catalogue.assignRolesOtherOrganization(username, organization, admin);
|
||||
extensionsCheck.put(username, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue