I chose to do a school project with asp.net mvc3 and there is a need of a user/role management. I think the membership that ships with asp.net is way too big for a school projec.
SO my thought is this. if i could find an equivalent of Zend predispatch
method for asp or even a better one i could store the urls accessible as privilege for a role and load it in session and check if a particular user have access to it and redirect if not.
my question are this:
Is there any equivalent of PreDispatch
method in asp?
Is there any better approach for my problem ? if yes please post resources
Thanks for reading this
EDIT i generate sublinks from databse using this:
public static class SubMenuHelper
{
public static MvcHtmlString GetSubMenu()
{
var db = new SchoolContextExpress();
var submenu = from s in db.Disciplines select s;
var sbuilder = new StringBuilder();
foreach (var discipline in submenu)
{
sbuilder.AppendFormat("<li><a class='sublink' href='/Discipline/Details/{0}'>{1}</a></li>", discipline.DisciplineID, discipline.Name);
}
return new MvcHtmlString(sbuilder.ToString());
}
}
You can implement like this.
----1 Enum------
----2 RequirePermissionFilter----
----3 Web.sitemap-----
----4 Menu Creator Action----
----5 Add helper to _Layout.cshtml
----6 Controller----
----AuthManager---