Interface GradebookPermissionService
-
public interface GradebookPermissionService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearPermissionsForUser(String gradebookUid, String userId)Remove all grader specific permissions for the given userMapgetAvailableItemsForStudent(Long gradebookId, String userId, String studentId, Collection courseSections)Get a map of itemId/permission(grade/view) of a student for a grader that he can grade or view for gradebook.MapgetAvailableItemsForStudent(String gradebookUid, String userId, String studentId, Collection courseSections)Get a map of itemId/permission(grade/view) of a student for a grader that he can grade or view for gradebook.MapgetAvailableItemsForStudents(Long gradebookId, String userId, List studentIds, Collection courseSections)Get a map of map for students whose IDs are in studentIds with id as key and another map as value: itemId/permission(grade/view) for a grader that he can grade or view for gradebook.MapgetAvailableItemsForStudents(String gradebookUid, String userId, List studentIds, Collection courseSections)Get a map of map for students whose IDs are in studentIds with id as key and another map as value: itemId/permission(grade/view) for a grader that he can grade or view for gradebook.List<Long>getCategoriesForUser(Long gradebookId, String userId, List<Long> categoryIdList)Get all available categories for a user that the user can either view or grade.List<Long>getCategoriesForUserForStudentView(Long gradebookId, String userId, String studentId, List<Long> categories, List<String> sectionIds)Returns viewable categorie id's for a user for a specific studentMapgetCourseGradePermission(Long gradebookId, String userId, List studentIds, List courseSections)Get a map with student IDs as key and view/grade as value for their course grade.MapgetCourseGradePermission(String gradebookUid, String userId, List studentIds, List courseSections)Get a map with student IDs as key and view/grade as value for their course grade.ListgetGraderPermissionsForUser(Long gradebookId, String userId)Get all Permission records associated with this user and gradebookListgetGraderPermissionsForUser(String gradebookUid, String userId)Get all Permission records associated with this user and gradebookbooleangetPermissionForUserForAllAssignment(Long gradebookId, String userId)Get true/false value for current user which indicats if he has permission for all assignments in a gradebook with category turned off or he has permission for assignments without category associated with in a gradebook with category turned on.booleangetPermissionForUserForAllAssignmentForStudent(Long gradebookId, String userId, String studentId, List sectionIds)Get true/false value for current user which indicates if he has permission for all gb items for a given studentList<PermissionDefinition>getPermissionsForUser(String gradebookUid, String userId)Get the grader specific permissions for the given userList<PermissionDefinition>getRealmsPermissionsForUser(String userUuid, String siteId, Role role)Get a list of permissions defined for the given user based on section and role or all sections if allowed.Map<String,String>getStudentsForItem(Long gradebookId, String userId, List<String> studentIds, int cateType, Long categoryId, List courseSections)Get students IDs that the current grader can either view or grade.Map<String,String>getStudentsForItem(String gradebookUid, String userId, List<String> studentIds, int cateType, Long categoryId, List courseSections)Get students IDs that the current grader can either view or grade.List<String>getViewableGroupsForUser(Long gradebookId, String userId, List<String> groupIds)Get all group ids associated with groups that contain at least one member that the user is authorized to view/gradeList<String>getViewableGroupsForUser(String gradebookUid, String userId, List<String> groupIds)Get all group ids associated with groups that contain at least one member that the user is authorized to view/gradeListgetViewableStudentsForUser(Long gradebookId, String userId, List studentIds, List sections)Get a unique list of students that the current user has grader permissions to view in some capacityListgetViewableStudentsForUser(String gradebookUid, String userId, List studentIds, List sections)Get a unique list of students that the current user has grader permissions to view in some capacityvoidupdatePermissionsForUser(String gradebookUid, String userId, List<PermissionDefinition> permissionDefinitions)Update the set of grader specific permissions for the given user
-
-
-
Method Detail
-
getCategoriesForUser
List<Long> getCategoriesForUser(Long gradebookId, String userId, List<Long> categoryIdList) throws IllegalArgumentException
Get all available categories for a user that the user can either view or grade. (For overview page)- Parameters:
gradebookId- Gradebook IDuserId- grader IDcategoryList- List of Category. (should be all categories for this gradebook)- Returns:
- List of categories
- Throws:
IllegalArgumentException
-
getCategoriesForUserForStudentView
List<Long> getCategoriesForUserForStudentView(Long gradebookId, String userId, String studentId, List<Long> categories, List<String> sectionIds) throws IllegalArgumentException
Returns viewable categorie id's for a user for a specific student- Parameters:
gradebookId-userId-studentId-categories-sectionIds-- Returns:
- Throws:
IllegalArgumentException
-
getPermissionForUserForAllAssignment
boolean getPermissionForUserForAllAssignment(Long gradebookId, String userId) throws IllegalArgumentException
Get true/false value for current user which indicats if he has permission for all assignments in a gradebook with category turned off or he has permission for assignments without category associated with in a gradebook with category turned on. (For overview page)- Parameters:
gradebookId- Gradebook IDuserId- grader ID- Returns:
- boolean of true/false
- Throws:
IllegalArgumentException
-
getPermissionForUserForAllAssignmentForStudent
boolean getPermissionForUserForAllAssignmentForStudent(Long gradebookId, String userId, String studentId, List sectionIds) throws IllegalArgumentException
Get true/false value for current user which indicates if he has permission for all gb items for a given student- Parameters:
gradebookId-userId-studentId-sectionIds-- Returns:
- Throws:
IllegalArgumentException
-
getStudentsForItem
Map<String,String> getStudentsForItem(Long gradebookId, String userId, List<String> studentIds, int cateType, Long categoryId, List courseSections) throws IllegalArgumentException
Get students IDs that the current grader can either view or grade. When categoryId is null and cateType is with category - return students' map that the grader can grade/view any category for course sections. (this is mostly for items that have no category associated with them in a gradebook with category turned on) (For item detail page)- Parameters:
gradebookId- Gradebook IDuserId- grader IDstudentIds- List of student IDscateType- gradebook category typecategoryId- current category ID that the permission check is based on. it can be null.courseSections- List of course sections for current site- Returns:
- Map of student IDs with grade/view as function value
- Throws:
IllegalArgumentException
-
getStudentsForItem
Map<String,String> getStudentsForItem(String gradebookUid, String userId, List<String> studentIds, int cateType, Long categoryId, List courseSections) throws IllegalArgumentException
Get students IDs that the current grader can either view or grade. When categoryId is null and cateType is with category - return students' map that the grader can grade/view any category for course sections. (this is mostly for items that have no category associated with them in a gradebook with category turned on) (For item detail page)- Parameters:
gradebookUid- gradebook uiduserId- grader IDstudentIds- List of student IDscateType- gradebook category typecategoryId- current category ID that the permission check is based on. it can be null.courseSections- List of course sections for current site- Returns:
- Map of student IDs with grade/view as function value
- Throws:
IllegalArgumentException
-
getAvailableItemsForStudent
Map getAvailableItemsForStudent(String gradebookUid, String userId, String studentId, Collection courseSections) throws IllegalArgumentException
Get a map of itemId/permission(grade/view) of a student for a grader that he can grade or view for gradebook. (For a student's roster page)- Parameters:
gradebookUid- Gradebook UIDuserId- grader IDstudentId- student IDcourseSections- List of course sections for current site- Returns:
- Map of item IDs with grade/view as function value
- Throws:
IllegalArgumentException
-
getAvailableItemsForStudent
Map getAvailableItemsForStudent(Long gradebookId, String userId, String studentId, Collection courseSections) throws IllegalArgumentException
Get a map of itemId/permission(grade/view) of a student for a grader that he can grade or view for gradebook. (For a student's roster page)- Parameters:
gradebookId- Gradebook IDuserId- grader IDstudentId- student IDcourseSections- List of course sections for current site- Returns:
- Map of item IDs with grade/view as function value
- Throws:
IllegalArgumentException
-
getAvailableItemsForStudents
Map getAvailableItemsForStudents(Long gradebookId, String userId, List studentIds, Collection courseSections) throws IllegalArgumentException
Get a map of map for students whose IDs are in studentIds with id as key and another map as value: itemId/permission(grade/view) for a grader that he can grade or view for gradebook. (For a student's roster page)- Parameters:
gradebookId- Gradebook IDuserId- grader IDstudentIds- List of student IDscourseSections- List of course sections for current site- Returns:
- Map
- Throws:
IllegalArgumentException
-
getAvailableItemsForStudents
Map getAvailableItemsForStudents(String gradebookUid, String userId, List studentIds, Collection courseSections) throws IllegalArgumentException
Get a map of map for students whose IDs are in studentIds with id as key and another map as value: itemId/permission(grade/view) for a grader that he can grade or view for gradebook. (For a student's roster page)- Parameters:
gradebookUid- Gradebook UIDuserId- grader IDstudentIds- List of student IDscourseSections- List of course sections for current site- Returns:
- Map
- Throws:
IllegalArgumentException
-
getCourseGradePermission
Map getCourseGradePermission(Long gradebookId, String userId, List studentIds, List courseSections) throws IllegalArgumentException
Get a map with student IDs as key and view/grade as value for their course grade. (For course grade page)- Parameters:
gradebookId- Gradebook IDuserId- grader IDstudentIds- List of student IDscourseSections- List of course sections for current site (Should be all course sections the current site has.)- Returns:
- Map of student IDs with view/grade as function value
- Throws:
IllegalArgumentException
-
getCourseGradePermission
Map getCourseGradePermission(String gradebookUid, String userId, List studentIds, List courseSections) throws IllegalArgumentException
Get a map with student IDs as key and view/grade as value for their course grade. (For course grade page)- Parameters:
gradebookUid- Gradebook UiduserId- grader IDstudentIds- List of student IDscourseSections- List of course sections for current site (Should be all course sections the current site has.)- Returns:
- Map of student IDs with view/grade as function value
- Throws:
IllegalArgumentException
-
getGraderPermissionsForUser
List getGraderPermissionsForUser(Long gradebookId, String userId)
Get all Permission records associated with this user and gradebook- Parameters:
gradebookId-userId-- Returns:
- List of Permission records for user and gradebook
-
getGraderPermissionsForUser
List getGraderPermissionsForUser(String gradebookUid, String userId)
Get all Permission records associated with this user and gradebook- Parameters:
gradebookUid-userId-- Returns:
- List of Permission records for user and gradebook
-
getViewableGroupsForUser
List<String> getViewableGroupsForUser(Long gradebookId, String userId, List<String> groupIds)
Get all group ids associated with groups that contain at least one member that the user is authorized to view/grade- Parameters:
gradebookId-userId-groupIds-- Returns:
- List of group ids that user has some authorization to view
-
getViewableGroupsForUser
List<String> getViewableGroupsForUser(String gradebookUid, String userId, List<String> groupIds)
Get all group ids associated with groups that contain at least one member that the user is authorized to view/grade- Parameters:
gradebookUid-userId-groupIds-- Returns:
- List of group ids that user has some authorization to view
-
getViewableStudentsForUser
List getViewableStudentsForUser(Long gradebookId, String userId, List studentIds, List sections)
Get a unique list of students that the current user has grader permissions to view in some capacity- Parameters:
gradebookId-userId-studentIds-sections-- Returns:
- List of student ids
-
getViewableStudentsForUser
List getViewableStudentsForUser(String gradebookUid, String userId, List studentIds, List sections)
Get a unique list of students that the current user has grader permissions to view in some capacity- Parameters:
gradebookUid-userId-studentIds-sections-- Returns:
- List of student ids
-
getPermissionsForUser
List<PermissionDefinition> getPermissionsForUser(String gradebookUid, String userId)
Get the grader specific permissions for the given user- Parameters:
gradebookUid-userId-- Returns:
-
updatePermissionsForUser
void updatePermissionsForUser(String gradebookUid, String userId, List<PermissionDefinition> permissionDefinitions)
Update the set of grader specific permissions for the given user- Parameters:
gradebookUid-userId-permissionDefinitions-
-
clearPermissionsForUser
void clearPermissionsForUser(String gradebookUid, String userId)
Remove all grader specific permissions for the given user- Parameters:
gradebookUid-userId-
-
getRealmsPermissionsForUser
List<PermissionDefinition> getRealmsPermissionsForUser(String userUuid, String siteId, Role role)
Get a list of permissions defined for the given user based on section and role or all sections if allowed. This method checks realms permissions for role/section and is independent of the gb_permissions_t permissions. note: If user has the grade privilege, they are given the GraderPermission.VIEW_COURSE_GRADE permission to match GB classic functionality. This needs to be reviewed.- Parameters:
userUuid-siteId-- Returns:
- list of
PermissionDefinitionsor empty list if none
-
-