GhSecurity.java 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package hello;
  2. import hello.accounts.entity.*;
  3. import com.techempower.gemini.*;
  4. import com.techempower.gemini.pyxis.*;
  5. /**
  6. * GhSecurity provides Pyxis-based security services for the
  7. * GeminiHello application.
  8. *
  9. * Development history:
  10. * 2012-04-19 - mh - Created
  11. *
  12. * @author mhixson
  13. */
  14. public class GhSecurity
  15. extends BasicSecurity<User, Group>
  16. {
  17. //
  18. // Member methods.
  19. //
  20. /**
  21. * Constructor.
  22. */
  23. public GhSecurity(GeminiApplication application)
  24. {
  25. super(application, User.class, Group.class);
  26. }
  27. /**
  28. * Constructs a PyxisUser object or a subclass thereof. Applications
  29. * should overload this method to return an instance of a BasicUser
  30. * subclass.
  31. */
  32. @Override
  33. public User constructUser()
  34. {
  35. return new User(this);
  36. }
  37. /**
  38. * Gets the logged-in user from the Context's session. Returns null
  39. * if no user is logged in.
  40. *
  41. * @param Context the Context from which to retrieve a user.
  42. */
  43. @Override
  44. public User getUser(Context context)
  45. {
  46. return (User)super.getUser(context);
  47. }
  48. } // End GhSecurity.