有关访问控制,自定义按钮,全局数据等的问题。 [英] Questions about Access Control, custom button, global data and some more.

查看:50
本文介绍了有关访问控制,自定义按钮,全局数据等的问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我一直在测试Lightswitch,但我遇到了一些问题。


 


我尝试使用表单身份验证访问Lightswitch的服务但是我我决定自己创建一个类似的进程,因为我已经有了一个包含我想要使用的用户名和密码的表。我做了一个"登录屏幕"用户输入他的数据
,如果这样的用户存在,我将关闭登录屏幕并打开另一个。现在讨论问题。


 


a)有没有办法隐藏菜单项(在左边),直到用户登录?


b)登录后,用户可以选择访问多个屏幕,每个屏幕上都会有一个名为"Logout"的按钮。在屏幕命令栏中,它将关闭所有屏幕并重新打开登录屏幕。是否可以编写自定义控件
等,这样我就不必复制+粘贴所有屏幕按钮的代码?


c)因为我想使用自定义身份验证有没有办法将当前用户保存到某种全局变量?我需要在屏幕之间访问这些数据。


d)我在我的用户表上查询了一个具有在登录屏幕上输入的相同用户名和密码的查询。只要更改了其中任何一个,查询就会运行。这没关系,但有没有办法通过点击
按钮来运行查询?


e)有没有办法阻止屏幕关闭?更具体地说,我想隐藏或禁用屏幕名称旁边的"x"。

解决方案

能够拥有一些外部登录页面/进程在Beta 1中不起作用,但是我们希望它可以在最终版本中运行(尽管它不是受支持的场景,我们已经在最近的版本内部尝试了它并且它工作正常)


关于你的问题


a)否。 隐藏这些内容的规则基于当前用户的权限,以及它的屏幕类型(带参数等)


b)您当然可以编写自定义控件这样做。 请注意,要做到这一点有点棘手;唯一可以肯定的方法是让浏览器中的Silverlight播放器完全消失。


c)你的自定义身份验证提供程序可能需要在线程/ HttpContext <上设置User / p>

d)当然。 任何查询都可以通过代码执行。 


e)对此不确定。 有没有像"Screen_CanClose"这样的东西?在"编写代码"中当你在屏幕设计师时下拉?


 


Hello. I've been testing Lightswitch and I've come to some problems.

 

I tried Access Service of Lightswitch using Forms Authentication but I decided I want to create a similar process on my own since I already have a table with user names and passwords that I want to use. I made a "Login Screen" where user inputs his data and if such user exists I would close the Login Screen and open another. Now onto the questions.

 

a) Is there a way to hide the menu items (on the left) until the user logs in?

b) After logging in the user would have options to access multiple screens and on each screen there would be a button named "Logout" in Screen Command Bar which would close all screens and reopen the Login Screen. Is it possible to write a custom control or such so I wouldn't have to copy+paste the code for the button for all of the screens?

c) Since I want to use custom Authentication is there a way to save the current user into some kind of global variable? I need to access this data between screens.

d) I made a query on my users table to find the one with the same user name and password that was input on the Login Screen. The query runs whenever any one of those are changed. That's quite all right but is there a way to run a query with a click of a button?

e) Is there a way to prevent a screen to close? To be more specific, I'd like to hide or disable the 'x' beside the screen name.

解决方案

The ability to have some external login page / process does not work in Beta 1, but we expect that it will work in the final release (although it is not a supported scenario, we have tried it internally on our most recent builds and it is working fine)

On to your questions

a) No.  The rules for hiding these things are based on the permissions of the current user, and the kind of screen it is (takes parameters, etc)

b) You could certainly write a custom control to do this.  Note that it's a bit tricky to get this right; the only way to be sure is to cause the Silverlight player in the browser to go away completely.

c) Your custom auth provider would probably need to set the User on the thread/HttpContext

d) Of course.  Any query can be executed via code. 

e) Not sure about this one.  Is there somethign like "Screen_CanClose" in the "Write Code" drop down when you are in screen designer?

 


这篇关于有关访问控制,自定义按钮,全局数据等的问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆