GetUserPermissionCache() public static method

public static GetUserPermissionCache ( CatsGlobals application ) : NetSqlAzMan.Cache.UserPermissionCache
application CatsGlobals
return NetSqlAzMan.Cache.UserPermissionCache
Exemplo n.º 1
0
        public static string isValidOperation(LogisticsConstants.Operation operation)
        {
            var    constants = new LogisticsConstants();
            string acces     = "";
            var    ewCache   = UserAccountHelper.GetUserPermissionCache(CatsGlobals.Applications.Logistics);

            if (ewCache.CheckAccess(constants.ItemName(operation), DateTime.Now) == AuthorizationType.Allow)
            {
                acces = operation.ToString();
            }
            return(acces);
        }
Exemplo n.º 2
0
        public static MvcHtmlString EarlyWarningOperationJsLink(this HtmlHelper helper, EarlyWarningConstants.Operation operation, string text = "", string clickFunction = "", string ccsClass = "btn-Approve-Gift", string dataButtontype = "", string id = "")
        {
            //return MvcHtmlString.Create(@"<a data-buttontype=" + dataButtontype + "  class=" + ccsClass + " href=" + url + ">" + text + "</a>");

            var constants = new EarlyWarningConstants();
            var ewCache   = UserAccountHelper.GetUserPermissionCache(CatsGlobals.Applications.EarlyWarning);

            // If cache is null then force the user to sign-in again
            if (null == ewCache)
            {
                Signout();
                return(MvcHtmlString.Create(string.Empty));
            }

            var html = string.Empty;

            if (ewCache.CheckAccess(constants.ItemName(operation), DateTime.Now) == AuthorizationType.Allow)
            {
                //html = @"<a data-buttontype=" + dataButtontype + " class=" + ccsClass + " href=" + url + ">" + text + "</a>";
                html = @"<a href='#'";
                if (ccsClass != "")
                {
                    html += " class='btn-success'";
                }
                if (id != "")
                {
                    html += " id=" + id;
                }
                if (dataButtontype != "")
                {
                    html += " data-buttontype=" + dataButtontype;
                }
                html += ">";
                if (clickFunction != "" && text != "")
                {
                    html += "<button type = 'button' class='btn btn-xs btn-success' ><span class='fa fa-check'></span>" + text + "</button></a>";
                }
                else
                {
                    html += " ><span class='fa fa-check'></span></a>";
                }
            }
            return(MvcHtmlString.Create(html));
        }
Exemplo n.º 3
0
        public static MvcHtmlString AdminOperationMenuItem(this HtmlHelper helper, string text, string url, string ccsClass = "", string dataButtontype = "")
        {
            var ewCache = UserAccountHelper.GetUserPermissionCache(CatsGlobals.Applications.Finance);

            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
            {
                html = @"<a data-buttontype=" + dataButtontype + "  class=" + ccsClass + " href=" + url + ">" + text + "</a>";
            }

            return(MvcHtmlString.Create(html));
        }
Exemplo n.º 4
0
        public static MvcHtmlString FinanceOperationMenuItem(this HtmlHelper helper, string text, string url, FinanceConstants.Operation operation, string ccsClass = "", string dataButtontype = "")
        {
            var constants = new FinanceConstants();
            var ewCache   = UserAccountHelper.GetUserPermissionCache(CatsGlobals.Applications.Finance);

            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));
        }
Exemplo n.º 5
0
        public static MvcHtmlString EarlyWarningOperationButton(this HtmlHelper helper, string url, EarlyWarningConstants.Operation operation, string text = "", string ccsClass = "", string dataButtontype = "", string id = "")
        {
            var constants = new EarlyWarningConstants();
            var ewCache   = UserAccountHelper.GetUserPermissionCache(CatsGlobals.Applications.EarlyWarning);

            // If cache is null then force the user to sign-in again
            if (null == ewCache)
            {
                Signout();
                return(MvcHtmlString.Create(string.Empty));
            }

            var html = string.Empty;

            if (ewCache.CheckAccess(constants.ItemName(operation), DateTime.Now) == AuthorizationType.Allow)
            {
                html = "<a href=" + url;
                if (ccsClass != "")
                {
                    html += " class=" + ccsClass;
                }
                if (id != "")
                {
                    html += " id=" + id;
                }
                if (dataButtontype != "")
                {
                    html += " data-buttontype=" + dataButtontype;
                }
                if (text != "")
                {
                    html += " >" + text + "</a>";
                }
                else
                {
                    html += " ></a>";
                }
            }
            return(MvcHtmlString.Create(html));
        }
Exemplo n.º 6
0
        public static MvcHtmlString AdminOperationButton(this HtmlHelper helper, string url, string text = "", string ccsClass = "", string dataButtontype = "", string id = "")
        {
            var ewCache = UserAccountHelper.GetUserPermissionCache(CatsGlobals.Applications.Finance);

            string 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
            {
                html = "<a href=" + url;
                if (ccsClass != "")
                {
                    html += " class=" + ccsClass;
                }
                if (id != "")
                {
                    html += " id=" + id;
                }
                if (dataButtontype != "")
                {
                    html += " data-buttontype=" + dataButtontype;
                }
                if (text != "")
                {
                    html += " >" + text + "</a>";
                }
                else
                {
                    html += " ></a>";
                }
            }
            return(MvcHtmlString.Create(html));
        }
Exemplo n.º 7
0
 public LogisticsAuthorize()
 {
     ewCache = UserAccountHelper.GetUserPermissionCache(CatsGlobals.Applications.Logistics);
 }
Exemplo n.º 8
0
 public PSNPAuthorize()
 {
     ewCache = UserAccountHelper.GetUserPermissionCache(CatsGlobals.Applications.PSNP);
 }
Exemplo n.º 9
0
 public EarlyWarningAuthorize()
 {
     ewCache = UserAccountHelper.GetUserPermissionCache(CatsGlobals.Applications.EarlyWarning);
 }
Exemplo n.º 10
0
 public RegionalAuthorize()
 {
     ewCache = UserAccountHelper.GetUserPermissionCache(CatsGlobals.Applications.Region);
 }
Exemplo n.º 11
0
 public ProcurementAuthorize()
 {
     ewCache = UserAccountHelper.GetUserPermissionCache(CatsGlobals.Applications.Procurement);
 }