org.sakaiproject.tool.gradebook.facades.sections
Class AuthzSectionsImpl

java.lang.Object
  extended byorg.sakaiproject.tool.gradebook.facades.sections.AbstractSectionsImpl
      extended byorg.sakaiproject.tool.gradebook.facades.sections.AuthzSectionsImpl
All Implemented Interfaces:
Authz
Direct Known Subclasses:
AuthzSakai2Impl

public class AuthzSectionsImpl
extends org.sakaiproject.tool.gradebook.facades.sections.AbstractSectionsImpl
implements Authz

An implementation of Gradebook-specific authorization needs based on the shared Section Awareness API.


Constructor Summary
AuthzSectionsImpl()
           
 
Method Summary
 List findMatchingEnrollments(String gradebookUid, String searchString, String optionalSectionUid)
           
 Authn getAuthn()
           
 List getAvailableEnrollments(String gradebookUid)
           
 List getAvailableSections(String gradebookUid)
           
protected  SectionAwareness getSectionAwareness()
           
 List getSectionEnrollments(String gradebookUid, String sectionUid)
          The section enrollment list will not be returned unless the user has access to it.
 boolean isUserAbleToEditAssessments(String gradebookUid)
           
 boolean isUserAbleToGrade(String gradebookUid)
           
 boolean isUserAbleToGradeAll(String gradebookUid)
           
 boolean isUserAbleToGradeSection(String sectionUid)
           
 boolean isUserAbleToGradeStudent(String gradebookUid, String studentUid)
          Note that this is not a particularly efficient implementation.
 boolean isUserAbleToViewOwnGrades(String gradebookUid)
           
 void setAuthn(Authn authn)
           
 void setSectionAwareness(SectionAwareness sectionAwareness)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthzSectionsImpl

public AuthzSectionsImpl()
Method Detail

isUserAbleToGrade

public boolean isUserAbleToGrade(String gradebookUid)
Specified by:
isUserAbleToGrade in interface Authz

isUserAbleToGradeAll

public boolean isUserAbleToGradeAll(String gradebookUid)
Specified by:
isUserAbleToGradeAll in interface Authz

isUserAbleToGradeSection

public boolean isUserAbleToGradeSection(String sectionUid)
Specified by:
isUserAbleToGradeSection in interface Authz

isUserAbleToEditAssessments

public boolean isUserAbleToEditAssessments(String gradebookUid)
Specified by:
isUserAbleToEditAssessments in interface Authz

isUserAbleToViewOwnGrades

public boolean isUserAbleToViewOwnGrades(String gradebookUid)
Specified by:
isUserAbleToViewOwnGrades in interface Authz

isUserAbleToGradeStudent

public boolean isUserAbleToGradeStudent(String gradebookUid,
                                        String studentUid)
Note that this is not a particularly efficient implementation. If the method becomes more heavily used, it should be optimized.

Specified by:
isUserAbleToGradeStudent in interface Authz

getAvailableEnrollments

public List getAvailableEnrollments(String gradebookUid)
Specified by:
getAvailableEnrollments in interface Authz
Returns:
an EnrollmentRecord list for each student that the current user is allowed to grade.

getAvailableSections

public List getAvailableSections(String gradebookUid)
Specified by:
getAvailableSections in interface Authz
Returns:
a CourseSection list for each group that the current user belongs to.

getSectionEnrollments

public List getSectionEnrollments(String gradebookUid,
                                  String sectionUid)
Description copied from interface: Authz
The section enrollment list will not be returned unless the user has access to it.

Specified by:
getSectionEnrollments in interface Authz
Returns:
an EnrollmentRecord list for all the students in the given group.

findMatchingEnrollments

public List findMatchingEnrollments(String gradebookUid,
                                    String searchString,
                                    String optionalSectionUid)
Specified by:
findMatchingEnrollments in interface Authz
Parameters:
searchString - a substring search for student name or display UID; the exact rules are up to the implementation
optionalSectionUid - null if the search should be made across all sections
Returns:
an EnrollmentRecord list for all matching available students.

getAuthn

public Authn getAuthn()

setAuthn

public void setAuthn(Authn authn)

getSectionAwareness

protected SectionAwareness getSectionAwareness()

setSectionAwareness

public void setSectionAwareness(SectionAwareness sectionAwareness)