Re: Security and Audit functionality
From: Raymond Lewallen (Raymond.CTR.Lewallen_at_nospam.faa.gov)
Date: 05/25/04
- Next message: Rich Yadach: "Access Denied w/Impersonate=true"
- Previous message: Roan Schuurman: "Re: Fixed Impersonation vs Current login user"
- In reply to: MattC: "Re: Security and Audit functionality"
- Next in thread: Prodip Saha: "Re: Security and Audit functionality"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 25 May 2004 12:19:17 -0500
Problem I ran into originally. It will return the class name of the ascx.
I have an SecurityControl.ascx file, but pass the calling class name as a
parameter into the SecurityControl function that does the validating.
"MattC" <m@m.com> wrote in message
news:%23aTzthlQEHA.3524@TK2MSFTNGP09.phx.gbl...
> Raymond,
> Cool solution. Here's a question.
>
> If the call to
> 'System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name' is
made
> within an ascx file which is a header that i place on every page. Will
> .Name return the class name of the control or thepage that contains it?
>
> Thanks
>
> Matt
>
>
> "Raymond Lewallen" <Raymond.CTR.Lewallen@nospam.faa.gov> wrote in message
> news:uUwfcPlQEHA.1644@TK2MSFTNGP09.phx.gbl...
> > > Although this would work, it does require that each page knows ahead
of
> > time
> > > what its SystemTask name is.
> >
> > I do something very similar. Each user logs into the application under
a
> > particular roleId. For the SystemTask name, I use the class name of the
> > code behind page. These SystemTasks and roleIds are cross-referenced in
a
> > table that I perform a lookup against. If a record is found, they can
see
> > the page and I record the audit data, otherwise if no record, no can see
> > page.
> >
> > To get the name of the class you are currently working in, use:
> >
> > System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name
> >
> > This is how I solve knowing what the SystemTask is ahead of time, as
each
> > aspx page is a task in our system.
> >
> > HTH,
> >
> > Raymond Lewallen
> >
> >
>
>
- Next message: Rich Yadach: "Access Denied w/Impersonate=true"
- Previous message: Roan Schuurman: "Re: Fixed Impersonation vs Current login user"
- In reply to: MattC: "Re: Security and Audit functionality"
- Next in thread: Prodip Saha: "Re: Security and Audit functionality"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]