Search in sources :

Example 6 with FeedbackResponseCommentsDb

use of teammates.storage.api.FeedbackResponseCommentsDb in project teammates by TEAMMATES.

the class InstructorFeedbackResponseCommentEditActionTest method testAccessControl.

@Override
@Test
protected void testAccessControl() throws Exception {
    final FeedbackQuestionsDb fqDb = new FeedbackQuestionsDb();
    final FeedbackResponsesDb frDb = new FeedbackResponsesDb();
    final FeedbackResponseCommentsDb frcDb = new FeedbackResponseCommentsDb();
    FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("session1InCourse1");
    int questionNumber = 1;
    FeedbackQuestionAttributes feedbackQuestion = fqDb.getFeedbackQuestion("First feedback session", "idOfTypicalCourse1", questionNumber);
    String giverEmail = "student1InCourse1@gmail.tmt";
    String receiverEmail = "student1InCourse1@gmail.tmt";
    FeedbackResponseAttributes feedbackResponse = frDb.getFeedbackResponse(feedbackQuestion.getId(), giverEmail, receiverEmail);
    FeedbackResponseCommentAttributes feedbackResponseComment = typicalBundle.feedbackResponseComments.get("comment1FromT1C1ToR1Q1S1C1");
    feedbackResponseComment = frcDb.getFeedbackResponseComment(feedbackResponse.getId(), feedbackResponseComment.giverEmail, feedbackResponseComment.createdAt);
    String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, feedbackResponse.getId(), Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ID, feedbackResponseComment.getId().toString(), Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_TEXT, "comment", Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE, "recipient" };
    // this person is not the giver. so not accessible
    verifyUnaccessibleWithoutModifySessionCommentInSectionsPrivilege(submissionParams);
    verifyOnlyInstructorsCanAccess(submissionParams);
}
Also used : FeedbackResponseCommentsDb(teammates.storage.api.FeedbackResponseCommentsDb) FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) FeedbackResponseAttributes(teammates.common.datatransfer.attributes.FeedbackResponseAttributes) FeedbackResponseCommentAttributes(teammates.common.datatransfer.attributes.FeedbackResponseCommentAttributes) FeedbackQuestionAttributes(teammates.common.datatransfer.attributes.FeedbackQuestionAttributes) FeedbackResponsesDb(teammates.storage.api.FeedbackResponsesDb) FeedbackQuestionsDb(teammates.storage.api.FeedbackQuestionsDb) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)6 FeedbackResponseCommentAttributes (teammates.common.datatransfer.attributes.FeedbackResponseCommentAttributes)6 FeedbackResponseCommentsDb (teammates.storage.api.FeedbackResponseCommentsDb)6 FeedbackQuestionAttributes (teammates.common.datatransfer.attributes.FeedbackQuestionAttributes)5 FeedbackResponseAttributes (teammates.common.datatransfer.attributes.FeedbackResponseAttributes)5 FeedbackQuestionsDb (teammates.storage.api.FeedbackQuestionsDb)5 FeedbackResponsesDb (teammates.storage.api.FeedbackResponsesDb)5 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)4 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)3 AjaxResult (teammates.ui.controller.AjaxResult)2 InstructorFeedbackResponseCommentAjaxPageData (teammates.ui.pagedata.InstructorFeedbackResponseCommentAjaxPageData)2 Text (com.google.appengine.api.datastore.Text)1 ArrayList (java.util.ArrayList)1 FeedbackResponseCommentSearchResultBundle (teammates.common.datatransfer.FeedbackResponseCommentSearchResultBundle)1 InstructorFeedbackResponseCommentDeleteAction (teammates.ui.controller.InstructorFeedbackResponseCommentDeleteAction)1 InstructorFeedbackResponseCommentEditAction (teammates.ui.controller.InstructorFeedbackResponseCommentEditAction)1