[Building Sakai] CourseManagementAdministration removeSectionMembership(..) ignores SecuityAdvisor ?

David Wafula davidwaf at gmail.com
Wed Aug 22 02:44:58 PDT 2012


Dear all,
Using 2.8.0.

The following code ignores the use of SecurityAdvisor when calling
CourseManagementAdministration.removeSectionMembership():

SecurityAdvisor localSecAdvisor=new SecurityAdvisor() {...}
try{
  securityService.pushAdvisor( localSecAdvisor);
 courseManagementAdministration.removeSectionMembership(user.getEid(),
sectionId)
}finally{
  securityService.popAdvisor( localSecAdvisor);
}


but works with this :

Session localSakaiSession = null;
User currentUser = null;
try{

            currentUser = userDirectoryService.getCurrentUser();
           localSakaiSession = sessionManager.getCurrentSession();
            localSakaiSession.setUserId("admin");
            localSakaiSession.setUserEid("admin");
...
...

}finally{
           localSakaiSession.setUserEid(currentUser.getEid());
            localSakaiSession.setUserId(currentUser.getId());
}


Is the try..finally safe when using
localSakaiSession.setUserId("admin") etc ?

Thanks.
-- 
David Wafula


More information about the sakai-dev mailing list