class AssessmentPermissionRules {

    @PermissionRule(value = "ASSESSMENT", description = "Only project finance or competition admin can see assessments " +
            "if the competition is in the correct state.")
    public boolean assessment(CompetitionCompositeId competitionCompositeId, UserResource loggedInUser) {
        CompetitionResource competition = competitionRestService.getCompetitionById(competitionCompositeId.id()).getSuccess();
        return isInternalAdmin(loggedInUser) &&
                !competitionIsInInformOrLater(competition) &&
                competitionIsInReadyToOpenOrLater(competition);
    }

}