package org.gcube.dataanalysis.dataminer.poolmanager.util;

***REMOVED***
import org.gcube.common.authorization.library.AuthorizationEntry;
***REMOVED***
***REMOVED***

import static org.gcube.common.authorization.client.Constants.authorizationService;


public class CheckPermission ***REMOVED***

	public CheckPermission() ***REMOVED***
***REMOVED***

	public static boolean apply(String VREToken, String vre) throws ObjectNotFound, Exception ***REMOVED***
		
		AuthorizationEntry entry = authorizationService().get(VREToken);
		if (entry.getContext().equals(vre)) ***REMOVED***
			System.out.println("Authorization OK!");
			return true;
	***REMOVED***
		System.out.println("Not a valid token recognized for the VRE: "+vre);
		return false;

***REMOVED***
***REMOVED***
