コード例 #1
0
 /// <summary>
 /// Load settings
 /// </summary>
 protected override void LoadSettings()
 {
     // Verify that the current user has access to view this module
     if (PortalSecurity.HasViewPermissions(ModuleID) == false)
     {
         // Removed by Mario Endara <*****@*****.**> (2004/11/04)
         //				&& PortalSecurity.IsInRoles("Admins") == false)
         PortalSecurity.AccessDenied();
     }
     base.LoadSettings();
 }
コード例 #2
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            // This method is executed before calling the action
            // and here you have access to the route data:
            var mID = (int)filterContext.ActionParameters["mID"];

            if (!PortalSecurity.HasViewPermissions(mID))
            {
                PortalSecurity.AccessDenied();
                filterContext.Result = new EmptyResult();
            }

            else
            {
                base.OnActionExecuting(filterContext);
            }
        }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: wforney/portal
 public ActionResult Module()
 {
     SetModuleId();
     if (PortalSecurity.HasViewPermissions(ModuleId))
     {
         var model = new FileManagerModel
         {
             PortalName     = PortalSettings.PortalFullPath,
             ModuleId       = ModuleId,
             ViewPermission = PortalSecurity.HasViewPermissions(ModuleId),
             EditPermission = PortalSecurity.HasEditPermissions(ModuleId)
         };
         return(View(model));
     }
     PortalSecurity.AccessDenied();
     return(new EmptyResult());
 }