Esempio n. 1
0
        public static MvcHtmlString HubOperationMenuItem(this HtmlHelper helper, string text, string url, HubConstants.Operation operation, string ccsClass = "", string dataButtontype = "")
        {
            var constants = new HubConstants();
            var ewCache   = UserAccountHelper.GetUserPermissionCache(CatsGlobals.Applications.Hub);

            var html = string.Empty;

            // If cache is null then force the user to sign-in again
            if (null == ewCache)
            {
                Signout();
                return(MvcHtmlString.Create(string.Empty));
            }
            else if (ewCache.CheckAccess(constants.ItemName(operation), DateTime.Now) == AuthorizationType.Allow)
            {
                html = @"<a data-buttontype=" + dataButtontype + "  class=" + ccsClass + " href=" + url + ">" + text + "</a>";
            }
            return(MvcHtmlString.Create(html));
        }