async function hasLecturerReviewRightsForSolutionId(solutionId, userId) {
  const queryText = `
  SELECT 
    count(solutions.id)>0
  FROM solutions
  LEFT JOIN homeworks on solutions.homeworkid = homeworks.id
  LEFT JOIN attends ON (
    attends.courseid = homeworks.courseid AND 
    (attends.islecturer OR attends.ismodulecoordinator) AND 
    attends.userid = $2
  )
  LEFT JOIN users ON users.userid = attends.userid
  WHERE solutions.id = $1
    AND users.isactive AND users.isemailverified
    AND attends.userid = $2
  `;
  const params = [solutionId, userId];
  return await databaseQuery(queryText, params);
}
/**
 * checks, whether a user is allowed to create a new LecturerReview for a given solution.
 *
 * @param {string} solutionId the solutionId for which the right should be checked
 * @param {string} userId the userId for which the right should be checked
 * @returns {boolean} true if user has right to create a LecturerReview, false if otherwise
 */
checks, whether a user is allowed to create a new LecturerReview for a given solution.
@param {string} solutionId the solutionId for which the right should be checked
@param {string} userId the userId for which the right should be checked
@returns {boolean} true if user has right to create a LecturerReview, false if otherwise
checks whether a user is allowed to create a new LecturerReview for a given solution . @param { string } solutionId the solutionId for which the right should be checked @param { string } userId the userId for which the right should be checked @returns { boolean } true if user has right to create a LecturerReview false if otherwise
async function hasLecturerReviewRightsForSolutionId(solutionId, userId) {
  const queryText = `
  SELECT 
    count(solutions.id)>0
  FROM solutions
  LEFT JOIN homeworks on solutions.homeworkid = homeworks.id
  LEFT JOIN attends ON (
    attends.courseid = homeworks.courseid AND 
    (attends.islecturer OR attends.ismodulecoordinator) AND 
    attends.userid = $2
  )
  LEFT JOIN users ON users.userid = attends.userid
  WHERE solutions.id = $1
    AND users.isactive AND users.isemailverified
    AND attends.userid = $2
  `;
  const params = [solutionId, userId];
  return await databaseQuery(queryText, params);
}
async function hasLecturerReviewRightsForSolutionId ( solutionId , userId ) { const queryText = ` ` ; const params = [ solutionId , userId ] ; return await databaseQuery ( queryText , params ) ; }
checks, whether a user is allowed to create a new LecturerReview for a given solution.
checks whether a user is allowed to create a new LecturerReview for a given solution .