Interface Authz


  • public interface Authz
    Facade to external role and authorization service.
    • Method Detail

      • isUserAbleToGrade

        boolean isUserAbleToGrade​(String gradebookUid)
      • isUserAbleToGrade

        boolean isUserAbleToGrade​(String gradebookUid,
                                  String userUid)
      • isUserAbleToGradeAll

        boolean isUserAbleToGradeAll​(String gradebookUid)
      • isUserAbleToGradeAll

        boolean isUserAbleToGradeAll​(String gradebookUid,
                                     String userUid)
      • isUserAbleToEditAssessments

        boolean isUserAbleToEditAssessments​(String gradebookUid)
      • isUserAbleToViewOwnGrades

        boolean isUserAbleToViewOwnGrades​(String gradebookUid)
      • isUserAbleToViewStudentNumbers

        boolean isUserAbleToViewStudentNumbers​(String gradebookUid)
      • isUserHasGraderPermissions

        boolean isUserHasGraderPermissions​(String gradebookUid)
      • isUserHasGraderPermissions

        boolean isUserHasGraderPermissions​(Long gradebookId)
      • isUserHasGraderPermissions

        boolean isUserHasGraderPermissions​(Long gradebookId,
                                           String userUid)
      • isUserHasGraderPermissions

        boolean isUserHasGraderPermissions​(String gradebookUid,
                                           String userUid)
      • isUserAbleToGradeItemForStudent

        boolean isUserAbleToGradeItemForStudent​(String gradebookUid,
                                                Long itemId,
                                                String studentUid)
                                         throws IllegalArgumentException
        Parameters:
        gradebookUid -
        itemId -
        studentUid -
        Returns:
        is user authorized to grade this gradebook item for this student? first checks for special grader perms. if none, uses default perms
        Throws:
        IllegalArgumentException
      • isUserAbleToViewItemForStudent

        boolean isUserAbleToViewItemForStudent​(String gradebookUid,
                                               Long itemId,
                                               String studentUid)
                                        throws IllegalArgumentException
        Parameters:
        gradebookUid -
        itemId -
        studentUid -
        Returns:
        is user authorized to view this gradebook item for this student? first checks for special grader perms. if none, uses default perms
        Throws:
        IllegalArgumentException
      • getAllSections

        List getAllSections​(String gradebookUid)
        Parameters:
        gradebookUid -
        Returns:
        all of the CourseSections for this site
      • getViewableSections

        List getViewableSections​(String gradebookUid)
        Parameters:
        gradebookUid -
        Returns:
        all CourseSections that the current user may view or grade
      • findMatchingEnrollmentsForItemForUser

        Map findMatchingEnrollmentsForItemForUser​(String userUid,
                                                  String gradebookUid,
                                                  Long categoryId,
                                                  int gbCategoryType,
                                                  String optionalSearchString,
                                                  String optionalSectionUid)
        Parameters:
        gradebookUid -
        userUid -
        categoryId - The category id that the desired item is associated with
        gbCategoryType - The category type setting for this gradebook
        optionalSearchString - a substring search for student name or display UID; the exact rules are up to the implementation - leave null to use all students
        optionalSectionUid - null if the search should be made across all sections
        Returns:
        a map of EnrollmentRecords to grade/view permission that the given user is authorized to view or grade for the given gradebook item
      • findMatchingEnrollmentsForItem

        Map findMatchingEnrollmentsForItem​(String gradebookUid,
                                           Long categoryId,
                                           int gbCategoryType,
                                           String optionalSearchString,
                                           String optionalSectionUid)
        Parameters:
        gradebookUid -
        categoryId - The category id that the desired item is associated with
        gbCategoryType - The category type setting for this gradebook
        optionalSearchString - a substring search for student name or display UID; the exact rules are up to the implementation - leave null to use all students
        optionalSectionUid - null if the search should be made across all sections
        Returns:
        a map of EnrollmentRecords to grade/view permission that the current user is authorized to view or grade for the given gradebook item
      • findMatchingEnrollmentsForViewableCourseGrade

        Map findMatchingEnrollmentsForViewableCourseGrade​(String gradebookUid,
                                                          int gbCategoryType,
                                                          String optionalSearchString,
                                                          String optionalSectionUid)
        Parameters:
        gradebookUid -
        gbCategoryType - The category type setting for this gradebook
        optionalSearchString -
        optionalSectionUid -
        Returns:
        Map of EnrollmentRecord --> function (grade/view) for all students that the current user has permission to view/grade every item in the gradebook. If he/she can grade everything, GRADE function is returned. Otherwise, function is VIEW. May only modify course grade if he/she can grade everything in the gradebook for that student. If he/she can grade only a subset of the items, the student is not returned.
      • findMatchingEnrollmentsForViewableItems

        Map findMatchingEnrollmentsForViewableItems​(String gradebookUid,
                                                    List allGbItems,
                                                    String optionalSearchString,
                                                    String optionalSectionUid)
        Parameters:
        gradebookUid -
        allGbItems - List of all Assignments associated with this gradebook
        optionalSearchString - a substring search for student name or display UID; the exact rules are up to the implementation - leave null to use all students
        optionalSectionUid - null if the search should be made across all sections
        Returns:
        a map of EnrollmentRecords to a map of item id and function (grade/view) that the user is authorized to view/grade
      • findStudentSectionMemberships

        List findStudentSectionMemberships​(String gradebookUid,
                                           String studentUid)
        Parameters:
        gradebookUid -
        studentUid -
        Returns:
        a list of all section memberships for the given studentUid
      • getStudentSectionMembershipNames

        List getStudentSectionMembershipNames​(String gradebookUid,
                                              String studentUid)
        Parameters:
        gradebookUid -
        studentUid -
        Returns:
        a list of the section membership names for the give studentUid
      • getGradeViewFunctionForUserForStudentForItem

        String getGradeViewFunctionForUserForStudentForItem​(String gradebookUid,
                                                            Long itemId,
                                                            String studentUid)
        Check to see if current user may grade or view the given student for the given item in the given gradebook. Returns string representation of function per GradebookService vars (view/grade) or null if no permission
        Parameters:
        gradebookUid -
        itemId -
        studentUid -
        Returns:
        GradebookService.gradePermission, GradebookService.viewPermission, or null if no permission