logo       

Setting the current user id in 2.2: msg#00393

cms.sakai.devel

Subject: Setting the current user id in 2.2

I'm trying to update the test-harness in 2.2, and I'm having difficulty "logging in" to sakai.

Here's what used to work for me:

Session session = SessionManager.getCurrentSession();
session.setUserId("admin");
session.setUserEid("admin");

But now calling UserDirectoryService.getCurrentUser().getId() returns an empty string. And when I try to take actions such as adding users, adding sites, etc, I get a PermissionException, since user is null.

I've even tried AuthzGroupService.refreshUser("admin"), but that doesn't fix this either. Does anyone have any ideas what I need to do to set the current userID in 2.2?

Thanks,
Josh

--
Josh Holtzman
Educational Technology Services, UC Berkeley
jholtzman@xxxxxxxxxxxx
510.643.7380

----------------------
This automatic notification message was sent by Sakai Collab
(http://collab.sakaiproject.org/portal) from the DG: Development site.
You can modify how you receive notifications at My Workspace > Preferences.




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise