Hi,
I am working on an ASP.NET website which uses forms authentication with a custom authentication mechanism (which sets e.Authenticated
programmatically on protected void Login_Authenticate(object sender, AuthenticateEventArgs e)
).
I have an ASP.NET sitemap. Some elements must be displayed only to logged in users. Others must be displayed only to one, unique user (ie. administrator, identified by a user name which will never change).
What I want to avoid:
- Set a custom role provider: too much code to write for a such basic thing,
- Transform the existing code, for example by removing sitemap and replacing it by a code-behind solution.
What I want to do:
- A pure code-behind solution which will let me assign roles on authenticate event.
Is it possible? How? If not, is there an easy-to-do workaround?