=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/BaseEventService.java' --- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/BaseEventService.java 2013-05-17 06:44:41 +0000 +++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/event/BaseEventService.java 2013-05-17 07:16:31 +0000 @@ -50,6 +50,7 @@ import org.hisp.dhis.user.CurrentUserService; import org.springframework.beans.factory.annotation.Autowired; +import java.util.Collection; import java.util.Date; /** @@ -102,6 +103,15 @@ { return new ImportSummary( ImportStatus.ERROR, "Event ID does not point to a valid program." ); } + else + { + Collection programsByCurrentUser = programService.getProgramsByCurrentUser(); + + if ( !programsByCurrentUser.contains( program ) ) + { + return new ImportSummary( ImportStatus.ERROR, "Current user does not have permission to access this program." ); + } + } OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( event.getOrganisationUnitId() );