public override SakurityResult Check(DynamicAction action)
        {
            if (action.Method.ReflectedType != Type)
            {
                return(SakurityResult.NotApplicable);
            }

            if (action.IsCommand() && _OnAllCommands)
            {
                return(_Allow && _Everyone ? SakurityResult.Allow : SakurityResult.Deny);
            }
            if (action.IsQuery() && _OnAllQueries)
            {
                return(_Allow && _Everyone ? SakurityResult.Allow : SakurityResult.Deny);
            }

            return(SakurityResult.NotApplicable);
        }
        public override SakurityResult Check(DynamicAction action)
        {
            if (action.Method.ReflectedType != Type)
            {
                return SakurityResult.NotApplicable;
            }

            if(action.IsCommand() && _OnAllCommands)
            {
                return _Allow && _Everyone ? SakurityResult.Allow : SakurityResult.Deny;
            }
            if (action.IsQuery() && _OnAllQueries)
            {
                return _Allow && _Everyone ? SakurityResult.Allow : SakurityResult.Deny;
            }

            return SakurityResult.NotApplicable;
        }
        private MenuItem BuildMenuItem(DynamicAction s, DynamicService service)
        {
            if (s is EntityAction || (!s.IsCollectionQuery() && s.IsQuery())|| !_Offica.IzOk(s))
            {
                return null;
            }
            var action = s.Method.Name;
            if (s.IsCollectionQuery())
            {
                action = action + ".jqgrid";
            }

            return new MenuItem
                   {
                   	Title = s.Method.Name,
                   	ActionUrl = VirtualPathUtility.ToAbsolute(string.Format("~/{0}/{1}", service.Name, action))
                   	,
                   	AnchorClass = "parent",
                   };
        }
Example #4
0
        private MenuItem BuildMenuItem(DynamicAction s, DynamicService service)
        {
            if (s is EntityAction || (!s.IsCollectionQuery() && s.IsQuery()) || !_Offica.IzOk(s))
            {
                return(null);
            }
            var action = s.Method.Name;

            if (s.IsCollectionQuery())
            {
                action = action + ".jqgrid";
            }

            return(new MenuItem
            {
                Title = s.Method.Name,
                ActionUrl = VirtualPathUtility.ToAbsolute(string.Format("~/{0}/{1}", service.Name, action))
                ,
                AnchorClass = "parent",
            });
        }