if(!exists)
permissions.add(p);
}
EnvironmentAPI eAPI = APILocator.getEnvironmentAPI();
eAPI.updateEnvironment(environment, permissions);
//If it was updated successfully lets set the session
if ( UtilMethods.isSet( request.getSession().getAttribute( WebKeys.SELECTED_ENVIRONMENTS + getUser().getUserId() ) ) ) {
//Get the selected environments from the session