fixing checkGrantToAccessFarmID

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/performfish-analytics-portlet@178489 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-03-06 11:10:30 +00:00
parent 0caf09e0e2
commit aaa7e39164
3 changed files with 9 additions and 21 deletions

View File

@ -28,9 +28,9 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="owner.project.facets" value="java"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/performfish-analytics-portlet-0.0.1-SNAPSHOT/WEB-INF/classes"/>

View File

@ -1,6 +1,6 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error

View File

@ -286,14 +286,15 @@ public class PerformFishAnalyticsServiceImpl extends RemoteServiceServlet
throw new Exception("Your input farm ID seems to be not valid. Please contact the D4Science support");
}
List<GCubeGroup> groups = new LiferayGroupManager().listGroupsByUser(userId);
log.info("Groups retrieved from LR are: ",groups);
log.debug("Groups retrieved from LR are: "+groups);
for (GCubeGroup g : groups) {
log.debug("Checking the group id: ",g.getGroupId());
if (g.getGroupId() == farmId)
log.info("GCubeGroup matching the FARM_ID {} found!",farmId);
log.debug("Checking the group id: "+g.getGroupId());
if (g.getGroupId() == farmId){
log.info("GCubeGroup matching the FARM_ID "+farmId+" found!");
return true;
}
}
log.info("GCubeGroup matching the FARM_ID {} NOT found!",farmId);
log.info("GCubeGroup matching the FARM_ID "+farmId+" NOT found!");
return false;
}else{
//IN TEST MODE NOT CHECKING NOTHING
@ -302,19 +303,6 @@ public class PerformFishAnalyticsServiceImpl extends RemoteServiceServlet
}
}
public static void main(String[] args) {
String farmID = "aaaa";
long farmId = -1;
try{
farmId = Long.parseLong(farmID);
}catch(Exception e){
System.out.println("Error parsing the farmID "+farmID+" as long");
}
System.out.println(farmId);
}
/**
* Decrypt and valid parameters.
*