示例#1
0
 public IActionResult Index()
 {
     this.ViewBag.ActiveTab  = tabID;
     this.ViewBag.Permission = PermissionControl.GetPermissionLevelString();
     this.ViewBag.LoggedIn   = PermissionControl.GetPermissionLevel() != PermissionControl.None;
     return(View());
 }
示例#2
0
        private void GenericViewBag()
        {
            int permissionLevel = PermissionControl.GetPermissionLevel();

            this.ViewBag.ActiveTab = tabID;

            this.ViewBag.Admin   = permissionLevel == PermissionControl.Admin;
            this.ViewBag.Teacher = (permissionLevel == PermissionControl.Teacher || permissionLevel == PermissionControl.Admin);
            this.ViewBag.Student = (permissionLevel == PermissionControl.Student || permissionLevel == PermissionControl.Teacher || permissionLevel == PermissionControl.Admin);
        }