class UserRoleFromContextService {

  public UserContextRole getUserRoleInNoteId(Long noteId) {
    Note contextNote = noteRepository.findByIdOrThrow(noteId);
    UUID currentUserId = userService.getCurrentUser().getId();

    if (contextNote.getUserId().equals(currentUserId)) {
      return UserContextRole.ENTITYOWNER;
    }
    return UserContextRole.USER;
  }

  @Autowired public  UserRoleFromContextService(
      UnitRepository<OkrChildUnit> unitRepository,
      ObjectiveRepository objectiveRepository,
      KeyResultRepository keyResultRepository,
      NoteRepository noteRepository,
      AdminUserRepository adminUserRepository,
      UserService userService);

}