Can I use a attribute to make .net impersonate another user?
- by Rising Star
I am familiar with impersonating an account in .net by using:
dim myIdentity as WindowsIdentity = someIdentity
using ctx as WindowsImpersonationContext = myIdentity.Impersonate()
doStuff()
end using
Is it possible to define a .net attribute so that I could write something like:
< runAsUser(someIdentity) public sub doStuff()
and then have the .net framework always impersonate when running the method doStuff()?