Пример #1
0
        public virtual bool CheckPermission()
        {
            if (TargetNode != null)
            {
                if (!SecurityHandler.HasPermission(TargetNode, PermissionType.See))
                {
                    ThrowNotFound();
                }
            }
            if (_appNode != null)
            {
                if (!SecurityHandler.HasPermission(_appNode, PermissionType.RunApplication))
                {
                    return(false);
                }
                if (TargetNode != null)
                {
                    Application appNode = null;

                    // Elevation: we should check required permissions here,
                    // regardless of the users permissions for the application.
                    using (new SystemAccount())
                    {
                        appNode = Node.Load <Application>(_appNode.Id);
                    }

                    if (!ActionFramework.HasRequiredPermissions(appNode, TargetNode))
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
Пример #2
0
 public virtual bool CheckPermission()
 {
     if (TargetNode != null)
     {
         if (!SecurityHandler.HasPermission(TargetNode, PermissionType.See))
         {
             ThrowNotFound();
         }
         if (!SecurityHandler.HasPermission(TargetNode, PermissionType.RunApplication))
         {
             return(false);
         }
     }
     if (_appNode != null)
     {
         if (!SecurityHandler.HasPermission(_appNode, PermissionType.RunApplication))
         {
             return(false);
         }
         if (TargetNode != null)
         {
             if (!ActionFramework.HasRequiredPermissions(Node.Load <Application>(_appNode.Id), TargetNode))
             {
                 return(false);
             }
         }
     }
     return(true);
 }