Accessing logged in user information from inside a module

  • Thread starter Thread starter Andy B.
  • Start date Start date
A

Andy B.

I have methods in a module that need to have access to the logged in users
information for logging purposes. How do I get access to the Membership and
MembershipUser objects in these methods without having to pass the objects
to them?
 
Those routines can instantiate the member objects, but if they are in a
library, it is better you instantiate and pass them. The main reason here is
separation of concerns. If the libraries are pulling Membership objects, you
make the library so it can only be used to log user info in a system that
uses the default method of setting up membership in the config file, which
means a web application only. If that constraint is not a horrible thing,
you can set up the class to do this, even if it breaks encapsulation.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

*********************************************
| Think outside the box |
*********************************************
 
Back
Top