Beispiel #1
0
    public override bool IsAccessibleToUser(HttpContext context, SiteMapNode node)
    {
        bool bVisible = false;

        try
        {
            ECountIdentity identity = Thread.CurrentPrincipal.Identity as ECountIdentity;
            if (identity != null && identity.UserInfo != null)
            {
                List <Operation> operations = identity.UserInfo.UserGroup.Operations.ToList();
                if (string.IsNullOrEmpty(node.Url))
                {
                    bVisible = true;
                }
                else
                {
                    if (node.Url.ToLower().Contains("logout.aspx"))
                    {
                        bVisible = true;
                    }
                    else
                    {
                        if (operations.Exists(o => string.Equals(o.CommandName, node.Url)))
                        {
                            bVisible = true;
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ExceptionHandler.HandleUIException(ex);
        }
        return(bVisible);
    }
Beispiel #2
0
 public ECountPrincipal(ECountIdentity identity)
 {
     _identity = identity;
 }