Interface Authz
-
public interface AuthzFacade to external role and authorization service.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPERMISSION_EDIT_ASSIGNMENTSstatic StringPERMISSION_GRADE_ALLstatic StringPERMISSION_GRADE_SECTIONstatic StringPERMISSION_VIEW_OWN_GRADESstatic StringPERMISSION_VIEW_STUDENT_NUMBERS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MapfindMatchingEnrollmentsForItem(String gradebookUid, Long categoryId, int gbCategoryType, String optionalSearchString, String optionalSectionUid)MapfindMatchingEnrollmentsForItemForUser(String userUid, String gradebookUid, Long categoryId, int gbCategoryType, String optionalSearchString, String optionalSectionUid)MapfindMatchingEnrollmentsForViewableCourseGrade(String gradebookUid, int gbCategoryType, String optionalSearchString, String optionalSectionUid)MapfindMatchingEnrollmentsForViewableItems(String gradebookUid, List allGbItems, String optionalSearchString, String optionalSectionUid)ListfindStudentSectionMemberships(String gradebookUid, String studentUid)ListgetAllSections(String gradebookUid)StringgetGradeViewFunctionForUserForStudentForItem(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.ListgetStudentSectionMembershipNames(String gradebookUid, String studentUid)ListgetViewableSections(String gradebookUid)booleanisUserAbleToEditAssessments(String gradebookUid)booleanisUserAbleToGrade(String gradebookUid)booleanisUserAbleToGrade(String gradebookUid, String userUid)booleanisUserAbleToGradeAll(String gradebookUid)booleanisUserAbleToGradeAll(String gradebookUid, String userUid)booleanisUserAbleToGradeItemForStudent(String gradebookUid, Long itemId, String studentUid)booleanisUserAbleToViewItemForStudent(String gradebookUid, Long itemId, String studentUid)booleanisUserAbleToViewOwnGrades(String gradebookUid)booleanisUserAbleToViewStudentNumbers(String gradebookUid)booleanisUserHasGraderPermissions(Long gradebookId)booleanisUserHasGraderPermissions(Long gradebookId, String userUid)booleanisUserHasGraderPermissions(String gradebookUid)booleanisUserHasGraderPermissions(String gradebookUid, String userUid)
-
-
-
Field Detail
-
PERMISSION_GRADE_ALL
static final String PERMISSION_GRADE_ALL
- See Also:
- Constant Field Values
-
PERMISSION_GRADE_SECTION
static final String PERMISSION_GRADE_SECTION
- See Also:
- Constant Field Values
-
PERMISSION_EDIT_ASSIGNMENTS
static final String PERMISSION_EDIT_ASSIGNMENTS
- See Also:
- Constant Field Values
-
PERMISSION_VIEW_OWN_GRADES
static final String PERMISSION_VIEW_OWN_GRADES
- See Also:
- Constant Field Values
-
PERMISSION_VIEW_STUDENT_NUMBERS
static final String PERMISSION_VIEW_STUDENT_NUMBERS
- See Also:
- Constant Field Values
-
-
Method Detail
-
isUserAbleToGrade
boolean isUserAbleToGrade(String gradebookUid)
-
isUserAbleToGradeAll
boolean isUserAbleToGradeAll(String gradebookUid)
-
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)
-
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 withgbCategoryType- The category type setting for this gradebookoptionalSearchString- a substring search for student name or display UID; the exact rules are up to the implementation - leave null to use all studentsoptionalSectionUid- 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 withgbCategoryType- The category type setting for this gradebookoptionalSearchString- a substring search for student name or display UID; the exact rules are up to the implementation - leave null to use all studentsoptionalSectionUid- 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 gradebookoptionalSearchString-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 gradebookoptionalSearchString- a substring search for student name or display UID; the exact rules are up to the implementation - leave null to use all studentsoptionalSectionUid- 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
-
-