<commit_before>@RALLY_US4556
Feature: As an SEA/LEA end user I would like to be able to write only to data within my hierarchy through the API,
  so that, even though I can access data outside of it because I have association with particular student,
  I should not be writing into data that I don't own.

  Scenario Outline: Write operations requiring explicit associations on an entity as an IT Admin Teacher
    Given I am logged in using "cgrayadmin" "cgray1234" to realm "IL"
    And format "application/vnd.slc+json"
    And entity URI <Entity Resource URI>
  # Bad Create
    #When the sli securityEvent collection is empty
    And a valid entity json document for a <Entity Type>
    When the entities referenced or associated edorg is out of my context
    When I post the entity
    Then I should receive a return code of 403
    #And a security event matching "^Access Denied" should be in the sli db
    #And I check to find if record is in sli db collection:
     #| collectionName      | expectedRecordCount | searchParameter       | searchValue                           |
     #| securityEvent       | 1                   | body.userEdOrg        | IL-SUNSET                             |
     #| securityEvent       | 1                   | body.targetEdOrgList  | IL                                    |
  # Create
    Given a valid entity json document for a <Entity Type>
    When the entities referenced or associated edorg is in my context
    When I post the entity
    Then I should receive a return code of 201
    And I should receive a new entity URI
  # Bad Update
    #When the sli securityEvent collection is empty
    And I try to update the previously created entity with an invalid reference
    Then I should receive a return code of 403
    #And a security event matching "^Access Denied" should be in the sli db
    #And I check to find if record is in sli db collection:
     #| collectionName      | expectedRecordCount | searchParameter       | searchValue                           |
     #| securityEvent       | 1                   | body.userEdOrg        | IL-SUNSET                             |
     #| securityEvent       | 1                   | body.targetEdOrgList  | IL                                    |
  # Bad Delete
    #When the sli securityEvent collection is empty
    And I try to delete an entity that is out of my write context
    Then I should receive a return code of 403
    #And a security event matching "^Access Denied" should be in the sli db
    #And I check to find if record is in sli db collection:
     #| collectionName      | expectedRecordCount | searchParameter       | searchValue                           |
     #| securityEvent       | 1                   | body.userEdOrg        | IL-SUNSET                             |
     #| securityEvent       | 1                   | body.targetEdOrgList  | IL                                    |

  Examples:
    | Entity Type                    | Entity Resource URI          |
    | "attendance"                   | "attendances"                |
    | "cohort"                       | "cohorts"                    |
    | "course"                       | "courses"                    |
    | "courseOffering"               | "courseOfferings"            |
    | "courseTranscript"             | "courseTranscripts"          |
    | "disciplineAction"             | "disciplineActions"          |
    | "disciplineIncident"           | "disciplineIncidents"        |
    | "gradebookEntry"               | "gradebookEntries"           |
    | "graduationPlan"               | "graduationPlans"            |
    | "section"                      | "sections"                   |
    | "session"                      | "sessions"                   |
    | "studentGradebookEntry"        | "studentGradebookEntries"    |
    | "studentProgramAssociation"    | "studentProgramAssociations" |
    | "studentSectionAssociation"    | "studentSectionAssociations" |
    | "studentSchoolAssociation"     | "studentSchoolAssociations"  |<commit_msg>de3005 - remove attendance PUT test from ecurity tests<commit_after>@RALLY_US4556
Feature: As an SEA/LEA end user I would like to be able to write only to data within my hierarchy through the API,
  so that, even though I can access data outside of it because I have association with particular student,
  I should not be writing into data that I don't own.

  Scenario Outline: Write operations requiring explicit associations on an entity as an IT Admin Teacher
    Given I am logged in using "cgrayadmin" "cgray1234" to realm "IL"
    And format "application/vnd.slc+json"
    And entity URI <Entity Resource URI>
  # Bad Create
    #When the sli securityEvent collection is empty
    And a valid entity json document for a <Entity Type>
    When the entities referenced or associated edorg is out of my context
    When I post the entity
    Then I should receive a return code of 403
    #And a security event matching "^Access Denied" should be in the sli db
    #And I check to find if record is in sli db collection:
     #| collectionName      | expectedRecordCount | searchParameter       | searchValue                           |
     #| securityEvent       | 1                   | body.userEdOrg        | IL-SUNSET                             |
     #| securityEvent       | 1                   | body.targetEdOrgList  | IL                                    |
  # Create
    Given a valid entity json document for a <Entity Type>
    When the entities referenced or associated edorg is in my context
    When I post the entity
    Then I should receive a return code of 201
    And I should receive a new entity URI
  # Bad Update
    #When the sli securityEvent collection is empty
    And I try to update the previously created entity with an invalid reference
    Then I should receive a return code of 403
    #And a security event matching "^Access Denied" should be in the sli db
    #And I check to find if record is in sli db collection:
     #| collectionName      | expectedRecordCount | searchParameter       | searchValue                           |
     #| securityEvent       | 1                   | body.userEdOrg        | IL-SUNSET                             |
     #| securityEvent       | 1                   | body.targetEdOrgList  | IL                                    |
  # Bad Delete
    #When the sli securityEvent collection is empty
    And I try to delete an entity that is out of my write context
    Then I should receive a return code of 403
    #And a security event matching "^Access Denied" should be in the sli db
    #And I check to find if record is in sli db collection:
     #| collectionName      | expectedRecordCount | searchParameter       | searchValue                           |
     #| securityEvent       | 1                   | body.userEdOrg        | IL-SUNSET                             |
     #| securityEvent       | 1                   | body.targetEdOrgList  | IL                                    |

  Examples:
    | Entity Type                    | Entity Resource URI          |
    | "cohort"                       | "cohorts"                    |
    | "course"                       | "courses"                    |
    | "courseOffering"               | "courseOfferings"            |
    | "courseTranscript"             | "courseTranscripts"          |
    | "disciplineAction"             | "disciplineActions"          |
    | "disciplineIncident"           | "disciplineIncidents"        |
    | "gradebookEntry"               | "gradebookEntries"           |
    | "graduationPlan"               | "graduationPlans"            |
    | "section"                      | "sections"                   |
    | "session"                      | "sessions"                   |
    | "studentGradebookEntry"        | "studentGradebookEntries"    |
    | "studentProgramAssociation"    | "studentProgramAssociations" |
    | "studentSectionAssociation"    | "studentSectionAssociations" |
    | "studentSchoolAssociation"     | "studentSchoolAssociations"  |
{'fraction_non_alphanumeric': 0.05509573810994441, 'fraction_numerical': 0.006917850525015441, 'mean_word_length': 1.6116129032258064, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6100910', 'n_tokens_mistral': 2039, 'n_tokens_neox': 1873, 'n_words': 779}