I am Using External Database With Hibernate As Persistence Layer
I Have Custom User (External Database) at Common Projects
This Current User Must Available at all Layer and must Filled before Any Request
Problem:
What I need is to find a way to fill this object (Current User) before Any Request so it cans Accessible from all layers without any effort like the Following MYContext.Current.CurrentUser
What I make:
I enable Session state For MOSS 2007
I Customize the Global.asax for SharePoint using the default Session_Start(object sender)Like the following
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
Dr Javool
Member
1 Points
2 Posts
Problem of Initialize and Make Current User (Custom Current User Getter) Available in All Layers ...
Mar 04, 2010 09:37 AM|LINK
The case:
Problem:
What I need is to find a way to fill this object (Current User) before Any Request so it cans Accessible from all layers without any effort like the Following MYContext.Current.CurrentUser
What I make:
Session[“CurrentUSer”]=MyCustomeUserManager.GetUserBySPID();
Thread.CurrentContext.SetProperty for set the Current User
Or Use the
Thread.CurrentPrincipal =MyCutomePrincipel
public MyCustomeClass User MYUser
{
get
{
Return (user)Thread.CurrentPrincipal;
Or Return (user) Thread.CurrentContext.GetProperty
}
Is this solution a good practice?
Is it correct to write again the default Global event, does this override the SharePoint Implementation?
Is Correct to write MyCutomePrincipel ?
Does there any other stratgy to implement all of this as good practice ?
Please Help??????
sharepoint session httpapplication global currenuser
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: Problem of Initialize and Make Current User (Custom Current User Getter) Available in All Lay...
Apr 02, 2010 01:33 PM|LINK
This is a duplicate of http://forums.asp.net/t/1532431.aspx
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239