Advertisement
Guest User

Untitled

a guest
Jan 30th, 2013
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. try {
  2. Context.openSession();
  3. Context.addProxyPrivilege(PrivilegeConstants.VIEW_PERSONS);
  4. UserService us = Context.getUserService();
  5. User user = us.getUserByUsername("tata");
  6. us.retireUser(u, "Not used anymore");
  7. } catch (Exception e) {
  8. e.printStackTrace();
  9. } finally {
  10. Context.removeProxyPrivilege(PrivilegeConstants.VIEW_PERSONS);
  11. Context.removeProxyPrivilege(PrivilegeConstants.EDIT_USERS);
  12. Context.closeSession();
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement