Add API to allow complete roundtrip from Authentication to User
Add API to allow complete roundtrip from Authentication to User

Without this change you need to do:

```
User user;
final SecurityContext oldContext = ACL.impersonate(a);
try {
    user = User.current();
} finally {
    SecurityContextHolder.setContext(oldContext);
}
```

Which seems incredibly wasteful.

Or else you need to replicate the logic in User.current() which makes that code hard to change.

varmenise/jenkins,paulwellnerbou/jenkins,oleg-nenashev/jenkins,viqueen/jenkins,guoxu0514/jenkins,petermarcoen/jenkins,ChrisA89/jenkins,jcsirot/jenkins,rlugojr/jenkins,seanlin816/jenkins,mrooney/jenkins,svanoort/jenkins,escoem/jenkins,yonglehou/jenkins,vvv444/jenkins,kohsuke/hudson,bpzhang/jenkins,noikiy/jenkins,batmat/jenkins,FTG-003/jenkins,vlajos/jenkins,jcsirot/jenkins,olivergondza/jenkins,daniel-beck/jenkins,SebastienGllmt/jenkins,ikedam/jenkins,MarkEWaite/jenkins,MarkEWaite/jenkins,ns163/jenkins,my7seven/jenkins,tfennelly/jenkins,verbitan/jenkins,escoem/jenkins,samatdav/jenkins,tastatur/jenkins,KostyaSha/jenkins,alvarolobato/jenkins,Ykus/jenkins,morficus/jenkins,azweb76/jenkins,Vlatombe/jenkins,gorcz/jenkins,FTG-003/jenkins,verbitan/jenkins,yonglehou/jenkins,aquarellian/jenkins,tfennelly/jenkins,rlugojr/jenkins,fbelzunc/jenkins,6WIND/jenkins,soenter/jenkins,SenolOzer/jenkins,rashmikanta-1984/jenkins,jk47/jenkins,arunsingh/jenkins,ErikVerheul/jenkins,MichaelPranovich/jenkins_sc,noikiy/jenkins,arunsingh/jenkins,andresrc/jenkins,amruthsoft9/Jenkis,jglick/jenkins,khmarbaise/jenkins,yonglehou/jenkins,vvv444/jenkins,ndeloof/jenkins,vijayto/jenkins,dbroady1/jenkins,batmat/jenkins,lordofthejars/jenkins,jpbriend/jenkins,NehemiahMi/jenkins,CodeShane/jenkins,morficus/jenkins,mdonohue/jenkins,vvv444/jenkins,lindzh/jenkins,lindzh/jenkins,varmenise/jenkins,mattclark/jenkins,morficus/jenkins,Ykus/jenkins,damianszczepanik/jenkins,daniel-beck/jenkins,mattclark/jenkins,pselle/jenkins,wuwen5/jenkins,vlajos/jenkins,FarmGeek4Life/jenkins,khmarbaise/jenkins,jenkinsci/jenkins,amuniz/jenkins,lordofthejars/jenkins,ns163/jenkins,liupugong/jenkins,paulwellnerbou/jenkins,brunocvcunha/jenkins,hashar/jenkins,varmenise/jenkins,daniel-beck/jenkins,mattclark/jenkins,samatdav/jenkins,wuwen5/jenkins,svanoort/jenkins,jk47/jenkins,akshayabd/jenkins,protazy/jenkins,paulmillar/jenkins,6WIND/jenkins,jpbriend/jenkins,samatdav/jenkins,protazy/jenkins,6WIND/jenkins,akshayabd/jenkins,albers/jenkins,paulwellnerbou/jenkins,pselle/jenkins,samatdav/jenkins,jhoblitt/jenkins,albers/jenkins,SebastienGllmt/jenkins,ydubreuil/jenkins,msrb/jenkins,hashar/jenkins,jenkinsci/jenkins,1and1/jenkins,escoem/jenkins,v1v/jenkins,azweb76/jenkins,Jimilian/jenkins,christ66/jenkins,SebastienGllmt/jenkins,Ykus/jenkins,Ykus/jenkins,liupugong/jenkins,ydubreuil/jenkins,olivergondza/jenkins,dbroady1/jenkins,morficus/jenkins,singh88/jenkins,liupugong/jenkins,olivergondza/jenkins,godfath3r/jenkins,jpederzolli/jenkins-1,hemantojhaa/jenkins,bkmeneguello/jenkins,msrb/jenkins,vvv444/jenkins,kohsuke/hudson,liupugong/jenkins,petermarcoen/jenkins,tfennelly/jenkins,kzantow/jenkins,batmat/jenkins,azweb76/jenkins,fbelzunc/jenkins,Krasnyanskiy/jenkins,batmat/jenkins,khmarbaise/jenkins,brunocvcunha/jenkins,amruthsoft9/Jenkis,ChrisA89/jenkins,tastatur/jenkins,rsandell/jenkins,viqueen/jenkins,verbitan/jenkins,6WIND/jenkins,scoheb/jenkins,fbelzunc/jenkins,wangyikai/jenkins,huybrechts/hudson,christ66/jenkins,ydubreuil/jenkins,bkmeneguello/jenkins,duzifang/my-jenkins,mattclark/jenkins,rashmikanta-1984/jenkins,jk47/jenkins,albers/jenkins,scoheb/jenkins,jenkinsci/jenkins,liorhson/jenkins,recena/jenkins,AustinKwang/jenkins,elkingtonmcb/jenkins,vlajos/jenkins,damianszczepanik/jenkins,everyonce/jenkins,vlajos/jenkins,jcsirot/jenkins,samatdav/jenkins,lindzh/jenkins,bkmeneguello/jenkins,singh88/jenkins,vvv444/jenkins,ndeloof/jenkins,hemantojhaa/jenkins,soenter/jenkins,kohsuke/hudson,intelchen/jenkins,hplatou/jenkins,olivergondza/jenkins,hashar/jenkins,tfennelly/jenkins,yonglehou/jenkins,292388900/jenkins,luoqii/jenkins,pselle/jenkins,scoheb/jenkins,azweb76/jenkins,recena/jenkins,wangyikai/jenkins,ndeloof/jenkins,gitaccountforprashant/gittest,amuniz/jenkins,soenter/jenkins,akshayabd/jenkins,rashmikanta-1984/jenkins,hemantojhaa/jenkins,v1v/jenkins,oleg-nenashev/jenkins,MichaelPranovich/jenkins_sc,NehemiahMi/jenkins,stephenc/jenkins,KostyaSha/jenkins,akshayabd/jenkins,seanlin816/jenkins,CodeShane/jenkins,petermarcoen/jenkins,escoem/jenkins,dariver/jenkins,jenkinsci/jenkins,chbiel/jenkins,ajshastri/jenkins,v1v/jenkins,SebastienGllmt/jenkins,guoxu0514/jenkins,dennisjlee/jenkins,singh88/jenkins,jhoblitt/jenkins,mcanthony/jenkins,6WIND/jenkins,292388900/jenkins,shahharsh/jenkins,Jimilian/jenkins,patbos/jenkins,aduprat/jenkins,noikiy/jenkins,rsandell/jenkins,vjuranek/jenkins,arunsingh/jenkins,rashmikanta-1984/jenkins,dariver/jenkins,arcivanov/jenkins,jpbriend/jenkins,evernat/jenkins,vvv444/jenkins,verbitan/jenkins,bpzhang/jenkins,kohsuke/hudson,olivergondza/jenkins,duzifang/my-jenkins,lindzh/jenkins,dennisjlee/jenkins,seanlin816/jenkins,rlugojr/jenkins,chbiel/jenkins,AustinKwang/jenkins,rlugojr/jenkins,aldaris/jenkins,dbroady1/jenkins,wuwen5/jenkins,guoxu0514/jenkins,dennisjlee/jenkins,oleg-nenashev/jenkins,ndeloof/jenkins,huybrechts/hudson,daniel-beck/jenkins,sathiya-mit/jenkins,svanoort/jenkins,hplatou/jenkins,msrb/jenkins,dbroady1/jenkins,liupugong/jenkins,ikedam/jenkins,petermarcoen/jenkins,SebastienGllmt/jenkins,amruthsoft9/Jenkis,SebastienGllmt/jenkins,NehemiahMi/jenkins,csimons/jenkins,protazy/jenkins,my7seven/jenkins,brunocvcunha/jenkins,gusreiber/jenkins,bpzhang/jenkins,KostyaSha/jenkins,ajshastri/jenkins,viqueen/jenkins,aquarellian/jenkins,kohsuke/hudson,vlajos/jenkins,soenter/jenkins,jenkinsci/jenkins,varmenise/jenkins,liupugong/jenkins,paulmillar/jenkins,v1v/jenkins,hashar/jenkins,shahharsh/jenkins,jpederzolli/jenkins-1,intelchen/jenkins,lindzh/jenkins,Krasnyanskiy/jenkins,hashar/jenkins,ajshastri/jenkins,ndeloof/jenkins,aldaris/jenkins,escoem/jenkins,lilyJi/jenkins,tastatur/jenkins,paulmillar/jenkins,292388900/jenkins,recena/jenkins,kzantow/jenkins,NehemiahMi/jenkins,jpederzolli/jenkins-1,chbiel/jenkins,gorcz/jenkins,jcsirot/jenkins,FTG-003/jenkins,luoqii/jenkins,samatdav/jenkins,fbelzunc/jenkins,chbiel/jenkins,amruthsoft9/Jenkis,1and1/jenkins,KostyaSha/jenkins,rsandell/jenkins,gitaccountforprashant/gittest,ajshastri/jenkins,msrb/jenkins,sathiya-mit/jenkins,christ66/jenkins,gitaccountforprashant/gittest,lordofthejars/jenkins,singh88/jenkins,gorcz/jenkins,hplatou/jenkins,vjuranek/jenkins,Jochen-A-Fuerbacher/jenkins,Ykus/jenkins,intelchen/jenkins,vjuranek/jenkins,alvarolobato/jenkins,escoem/jenkins,arunsingh/jenkins,dbroady1/jenkins,MichaelPranovich/jenkins_sc,bpzhang/jenkins,tastatur/jenkins,petermarcoen/jenkins,ErikVerheul/jenkins,alvarolobato/jenkins,seanlin816/jenkins,jpbriend/jenkins,Jochen-A-Fuerbacher/jenkins,oleg-nenashev/jenkins,jglick/jenkins,viqueen/jenkins,csimons/jenkins,soenter/jenkins,everyonce/jenkins,jglick/jenkins,lilyJi/jenkins,batmat/jenkins,ydubreuil/jenkins,khmarbaise/jenkins,daniel-beck/jenkins,arunsingh/jenkins,jcsirot/jenkins,ydubreuil/jenkins,guoxu0514/jenkins,vjuranek/jenkins,jglick/jenkins,gusreiber/jenkins,Jochen-A-Fuerbacher/jenkins,tangkun75/jenkins,godfath3r/jenkins,amuniz/jenkins,everyonce/jenkins,soenter/jenkins,ChrisA89/jenkins,ikedam/jenkins,csimons/jenkins,mdonohue/jenkins,MarkEWaite/jenkins,kzantow/jenkins,tastatur/jenkins,gorcz/jenkins,my7seven/jenkins,jhoblitt/jenkins,liorhson/jenkins,mdonohue/jenkins,olivergondza/jenkins,DanielWeber/jenkins,jk47/jenkins,Vlatombe/jenkins,guoxu0514/jenkins,mcanthony/jenkins,Krasnyanskiy/jenkins,khmarbaise/jenkins,rashmikanta-1984/jenkins,DanielWeber/jenkins,292388900/jenkins,my7seven/jenkins,duzifang/my-jenkins,luoqii/jenkins,SenolOzer/jenkins,DanielWeber/jenkins,Jochen-A-Fuerbacher/jenkins,aldaris/jenkins,arcivanov/jenkins,petermarcoen/jenkins,intelchen/jenkins,DanielWeber/jenkins,viqueen/jenkins,jenkinsci/jenkins,csimons/jenkins,jcsirot/jenkins,scoheb/jenkins,v1v/jenkins,pselle/jenkins,daniel-beck/jenkins,andresrc/jenkins,gitaccountforprashant/gittest,rsandell/jenkins,jpederzolli/jenkins-1,AustinKwang/jenkins,hplatou/jenkins,shahharsh/jenkins,CodeShane/jenkins,mcanthony/jenkins,iqstack/jenkins,huybrechts/hudson,6WIND/jenkins,iqstack/jenkins,kohsuke/hudson,viqueen/jenkins,evernat/jenkins,protazy/jenkins,rlugojr/jenkins,vjuranek/jenkins,intelchen/jenkins,wangyikai/jenkins,KostyaSha/jenkins,fbelzunc/jenkins,fbelzunc/jenkins,Ykus/jenkins,damianszczepanik/jenkins,hashar/jenkins,csimons/jenkins,alvarolobato/jenkins,shahharsh/jenkins,paulmillar/jenkins,hplatou/jenkins,alvarolobato/jenkins,aquarellian/jenkins,vijayto/jenkins,godfath3r/jenkins,pjanouse/jenkins,svanoort/jenkins,dbroady1/jenkins,bpzhang/jenkins,gusreiber/jenkins,hplatou/jenkins,aldaris/jenkins,elkingtonmcb/jenkins,scoheb/jenkins,v1v/jenkins,akshayabd/jenkins,csimons/jenkins,6WIND/jenkins,soenter/jenkins,recena/jenkins,hashar/jenkins,mdonohue/jenkins,intelchen/jenkins,rlugojr/jenkins,mrooney/jenkins,ns163/jenkins,viqueen/jenkins,dennisjlee/jenkins,vijayto/jenkins,everyonce/jenkins,aduprat/jenkins,pjanouse/jenkins,godfath3r/jenkins,vijayto/jenkins,lindzh/jenkins,tangkun75/jenkins,1and1/jenkins,protazy/jenkins,Krasnyanskiy/jenkins,gorcz/jenkins,ajshastri/jenkins,jk47/jenkins,pselle/jenkins,msrb/jenkins,evernat/jenkins,FarmGeek4Life/jenkins,292388900/jenkins,mdonohue/jenkins,NehemiahMi/jenkins,FarmGeek4Life/jenkins,batmat/jenkins,elkingtonmcb/jenkins,Krasnyanskiy/jenkins,guoxu0514/jenkins,wuwen5/jenkins,hemantojhaa/jenkins,DanielWeber/jenkins,chbiel/jenkins,iqstack/jenkins,1and1/jenkins,seanlin816/jenkins,iqstack/jenkins,msrb/jenkins,wangyikai/jenkins,hemantojhaa/jenkins,292388900/jenkins,vlajos/jenkins,DanielWeber/jenkins,MichaelPranovich/jenkins_sc,aduprat/jenkins,recena/jenkins,FTG-003/jenkins,patbos/jenkins,tangkun75/jenkins,jpederzolli/jenkins-1,ikedam/jenkins,akshayabd/jenkins,olivergondza/jenkins,morficus/jenkins,pjanouse/jenkins,lilyJi/jenkins,alvarolobato/jenkins,mrooney/jenkins,shahharsh/jenkins,mrooney/jenkins,bkmeneguello/jenkins,christ66/jenkins,rsandell/jenkins,paulmillar/jenkins,jglick/jenkins,sathiya-mit/jenkins,FTG-003/jenkins,jhoblitt/jenkins,elkingtonmcb/jenkins,oleg-nenashev/jenkins,andresrc/jenkins,pjanouse/jenkins,Vlatombe/jenkins,ChrisA89/jenkins,albers/jenkins,azweb76/jenkins,CodeShane/jenkins,FarmGeek4Life/jenkins,svanoort/jenkins,vijayto/jenkins,hplatou/jenkins,Jimilian/jenkins,kzantow/jenkins,aquarellian/jenkins,ErikVerheul/jenkins,lindzh/jenkins,Jochen-A-Fuerbacher/jenkins,my7seven/jenkins,huybrechts/hudson,paulwellnerbou/jenkins,luoqii/jenkins,pselle/jenkins,patbos/jenkins,arcivanov/jenkins,shahharsh/jenkins,ndeloof/jenkins,sathiya-mit/jenkins,pjanouse/jenkins,mcanthony/jenkins,huybrechts/hudson,liorhson/jenkins,gitaccountforprashant/gittest,brunocvcunha/jenkins,stephenc/jenkins,gorcz/jenkins,yonglehou/jenkins,aldaris/jenkins,FTG-003/jenkins,albers/jenkins,morficus/jenkins,pjanouse/jenkins,1and1/jenkins,aldaris/jenkins,christ66/jenkins,shahharsh/jenkins,ns163/jenkins,tfennelly/jenkins,chbiel/jenkins,lilyJi/jenkins,duzifang/my-jenkins,Jochen-A-Fuerbacher/jenkins,my7seven/jenkins,mdonohue/jenkins,iqstack/jenkins,sathiya-mit/jenkins,damianszczepanik/jenkins,arunsingh/jenkins,andresrc/jenkins,vvv444/jenkins,Jimilian/jenkins,luoqii/jenkins,SenolOzer/jenkins,KostyaSha/jenkins,bpzhang/jenkins,huybrechts/hudson,varmenise/jenkins,mattclark/jenkins,vijayto/jenkins,stephenc/jenkins,sathiya-mit/jenkins,sathiya-mit/jenkins,ydubreuil/jenkins,tangkun75/jenkins,patbos/jenkins,azweb76/jenkins,gusreiber/jenkins,amruthsoft9/Jenkis,Ykus/jenkins,gorcz/jenkins,amruthsoft9/Jenkis,tfennelly/jenkins,jenkinsci/jenkins,MarkEWaite/jenkins,damianszczepanik/jenkins,aduprat/jenkins,varmenise/jenkins,dariver/jenkins,my7seven/jenkins,ChrisA89/jenkins,amuniz/jenkins,brunocvcunha/jenkins,Jimilian/jenkins,ndeloof/jenkins,aduprat/jenkins,wuwen5/jenkins,lilyJi/jenkins,jglick/jenkins,bkmeneguello/jenkins,jenkinsci/jenkins,andresrc/jenkins,dennisjlee/jenkins,albers/jenkins,noikiy/jenkins,azweb76/jenkins,lilyJi/jenkins,seanlin816/jenkins,vijayto/jenkins,arcivanov/jenkins,aquarellian/jenkins,SenolOzer/jenkins,jhoblitt/jenkins,duzifang/my-jenkins,v1v/jenkins,wangyikai/jenkins,bpzhang/jenkins,gusreiber/jenkins,AustinKwang/jenkins,tfennelly/jenkins,verbitan/jenkins,msrb/jenkins,wangyikai/jenkins,evernat/jenkins,dariver/jenkins,godfath3r/jenkins,lordofthejars/jenkins,aduprat/jenkins,mcanthony/jenkins,christ66/jenkins,aldaris/jenkins,1and1/jenkins,liupugong/jenkins,seanlin816/jenkins,FarmGeek4Life/jenkins,gitaccountforprashant/gittest,AustinKwang/jenkins,mdonohue/jenkins,everyonce/jenkins,paulwellnerbou/jenkins,liorhson/jenkins,yonglehou/jenkins,evernat/jenkins,oleg-nenashev/jenkins,ns163/jenkins,elkingtonmcb/jenkins,guoxu0514/jenkins,daniel-beck/jenkins,gitaccountforprashant/gittest,lordofthejars/jenkins,arcivanov/jenkins,rashmikanta-1984/jenkins,arunsingh/jenkins,everyonce/jenkins,lilyJi/jenkins,MarkEWaite/jenkins,recena/jenkins,patbos/jenkins,elkingtonmcb/jenkins,batmat/jenkins,amuniz/jenkins,rsandell/jenkins,dennisjlee/jenkins,svanoort/jenkins,MarkEWaite/jenkins,patbos/jenkins,NehemiahMi/jenkins,noikiy/jenkins,rsandell/jenkins,petermarcoen/jenkins,292388900/jenkins,Krasnyanskiy/jenkins,bkmeneguello/jenkins,alvarolobato/jenkins,damianszczepanik/jenkins,svanoort/jenkins,tangkun75/jenkins,stephenc/jenkins,kzantow/jenkins,varmenise/jenkins,mcanthony/jenkins,CodeShane/jenkins,vjuranek/jenkins,ajshastri/jenkins,lordofthejars/jenkins,paulwellnerbou/jenkins,khmarbaise/jenkins,kohsuke/hudson,jpbriend/jenkins,recena/jenkins,duzifang/my-jenkins,tangkun75/jenkins,pjanouse/jenkins,protazy/jenkins,noikiy/jenkins,chbiel/jenkins,ns163/jenkins,vjuranek/jenkins,ikedam/jenkins,arcivanov/jenkins,dariver/jenkins,SenolOzer/jenkins,jhoblitt/jenkins,gorcz/jenkins,ChrisA89/jenkins,CodeShane/jenkins,MarkEWaite/jenkins,wuwen5/jenkins,jpederzolli/jenkins-1,brunocvcunha/jenkins,jglick/jenkins,lordofthejars/jenkins,Vlatombe/jenkins,amruthsoft9/Jenkis,stephenc/jenkins,yonglehou/jenkins,CodeShane/jenkins,jk47/jenkins,Jimilian/jenkins,daniel-beck/jenkins,rashmikanta-1984/jenkins,paulwellnerbou/jenkins,ErikVerheul/jenkins,christ66/jenkins,godfath3r/jenkins,bkmeneguello/jenkins,tangkun75/jenkins,FTG-003/jenkins,tastatur/jenkins,andresrc/jenkins,ChrisA89/jenkins,arcivanov/jenkins,brunocvcunha/jenkins,liorhson/jenkins,ErikVerheul/jenkins,Jimilian/jenkins,protazy/jenkins,ErikVerheul/jenkins,ajshastri/jenkins,mrooney/jenkins,amuniz/jenkins,Vlatombe/jenkins,gusreiber/jenkins,jpbriend/jenkins,damianszczepanik/jenkins,singh88/jenkins,Vlatombe/jenkins,evernat/jenkins,noikiy/jenkins,jpbriend/jenkins,mrooney/jenkins,kzantow/jenkins,iqstack/jenkins,AustinKwang/jenkins,Krasnyanskiy/jenkins,intelchen/jenkins,paulmillar/jenkins,dariver/jenkins,AustinKwang/jenkins,hemantojhaa/jenkins,ikedam/jenkins,singh88/jenkins,samatdav/jenkins,luoqii/jenkins,jpederzolli/jenkins-1,stephenc/jenkins,KostyaSha/jenkins,godfath3r/jenkins,oleg-nenashev/jenkins,jk47/jenkins,vlajos/jenkins,andresrc/jenkins,SebastienGllmt/jenkins,kohsuke/hudson,FarmGeek4Life/jenkins,SenolOzer/jenkins,shahharsh/jenkins,hemantojhaa/jenkins,FarmGeek4Life/jenkins,gusreiber/jenkins,rlugojr/jenkins,ikedam/jenkins,mcanthony/jenkins,verbitan/jenkins,dbroady1/jenkins,ydubreuil/jenkins,patbos/jenkins,luoqii/jenkins,verbitan/jenkins,jhoblitt/jenkins,everyonce/jenkins,escoem/jenkins,Jochen-A-Fuerbacher/jenkins,amuniz/jenkins,iqstack/jenkins,MarkEWaite/jenkins,csimons/jenkins,NehemiahMi/jenkins,morficus/jenkins,liorhson/jenkins,akshayabd/jenkins,aquarellian/jenkins,SenolOzer/jenkins,dariver/jenkins,ikedam/jenkins,paulmillar/jenkins,stephenc/jenkins,damianszczepanik/jenkins,scoheb/jenkins,mattclark/jenkins,wangyikai/jenkins,ns163/jenkins,liorhson/jenkins,mrooney/jenkins,fbelzunc/jenkins,duzifang/my-jenkins,pselle/jenkins,huybrechts/hudson,elkingtonmcb/jenkins,kzantow/jenkins,ErikVerheul/jenkins,mattclark/jenkins,MichaelPranovich/jenkins_sc,scoheb/jenkins,evernat/jenkins,dennisjlee/jenkins,KostyaSha/jenkins,jcsirot/jenkins,1and1/jenkins,aquarellian/jenkins,MichaelPranovich/jenkins_sc,MichaelPranovich/jenkins_sc,khmarbaise/jenkins,Vlatombe/jenkins,rsandell/jenkins,singh88/jenkins,tastatur/jenkins,DanielWeber/jenkins,albers/jenkins,aduprat/jenkins,wuwen5/jenkins