示例#1
0
        private void treeView1_DoubleClick(object sender, EventArgs e)
        {
            var resource = (SecurityResourceDto)((TreeView)sender).SelectedNode.Tag;

            if (resource != null)
            {
                if (UserContext.CurrentToken != null)
                {
                    var authResult = presenter.CheckAccess(resource, UserContext.CurrentToken);
                    var userInfo   = UserInfoGenerator.GenerateUserInfo(authResult.AccessToken, UserContext.CurrentToken);
                    if (authResult.AccessToken[1])
                    {
                        MessageBox.Show("has 1 access");
                    }
                    else
                    {
                        MessageBox.Show("has not 1 access");
                    }
                    if (authResult.AccessToken["Insert"])
                    {
                        MessageBox.Show("has insert access");
                    }
                }
            }
        }