Beispiel #1
0
        public PartialViewResult Menu()
        {
            IAuthorities[]     list;
            IRole              role          = irep.GetUsersRole(userName);
            List <Authorities> urlListToShow = new List <Authorities>();

            if (role.SuperAdmin == true)
            {
                list = irep.GetAllAuthorities();
            }
            else
            {
                list = irep.GetRolesAuthority(role.Role_Name);
            }
            foreach (Authorities au in list)
            {
                if (au.Url.Contains("Home"))
                {
                    urlListToShow.Add(au);
                }
            }
            ViewBag.UrlListToShow = urlListToShow;
            ViewBag.UserName      = userName;
            return(PartialView());
        }
Beispiel #2
0
 public ActionResult AuthorityCheck(string roleName)
 {
     return(View(irep.GetRolesAuthority(roleName)));
 }