如何根据用户特定角色加载UI [英] How do I load a UI based on a user specific role

查看:50
本文介绍了如何根据用户特定角色加载UI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这只是一个教育性的查询,其中我正在尝试根据分配给用户的角色来完成加载特定UI(登录后屏幕)的应用程序。

我只需要学习材料并继续阅读,我一直在搜索谷歌,我发现这篇文章到目前为止



PluginManager - AC#实用程序,用于加载基于插件的组件 [ ^ ]



它几乎接近我想要研究和完成的内容,只是它没有完整描述插件的创建方式以及如何创建插件管理器。



正如我所说,我正在尝试根据分配给用户的角色来完成加载特定用户界面的应用程序。背后的原因是应用程序的每个用户都有一个完全不同的工作,它更像是一个基于权限的应用程序,不仅仅是为了安全,而且还有一个特定于角色的良好UI设计。



所以我只是要求提供有关此类事项的参考资料,任何文章或代码样本都非常有用。我仍在寻找消息来源和其他样本,但我认为获得更个性化的建议是最好的。



提前谢谢

This is just an educational query wherein I am trying to accomplish an application that loads a specific UI (after login screen) depending on a role assigned to a user.
I just need materials to study and read on, I have been searching google and I found this article so far

PluginManager - A C# utility to load plug-in based components[^]

Its almost close to what I am trying to study and accomplish, only that it does not full describe how the plugin is created and how to create the plugin manager.

As I said I am trying to accomplish an application that loads specific user interface depending on a role assigned to a user. The reason behind is that each user of the app has a totally different job than the other, its more like a permission based app not just for security but also for a good UI design specific to a role.

So I am only asking for references regarding such matter, any article or code samples will be very useful. I am still looking for sources and other samples, but I think getting a more personal suggestions would be best.

Thank you in advance

推荐答案

Scott Mitchell撰写了一系列关于创建动态数据的文章驱动的用户界面 - 请参阅 http://aspnet.4guysfromrolla.com/articles/082008-1.aspx [ ^ ]。它适用于webforms,但原则也可以应用于WinForms。



还有一个 MS文章 [ ^ ] - 再次基于网络,但在那里有一些有用的东西



我假设你很乐意通过动态向表单添加控件代码,但以防万一(以及其他任何绊脚石)这里有一个教程 [ ^ ]



我见过的另一种技术是使用预先构建的表单,但确定可以加载的实际表单的数据是基于角色表。有一种控制器类,使用别名形式调用,它可以显示所需的表单,也可以根据需要显示通用的你不能这样做的表格。对不起,细节有点模糊,但很久以前,它是用VB的旧形式写的,仍然是无名的。



有一个商业CRM将所有UI定义存储在数据库中的产品 - 我的意思是全部!表单的形式或部分是在运行时从所有信息中生成的。你可以想象,有时候导航可能会很慢。但是通过保持表单简单来减轻这种情况。如果你有固定区域,那么这将减轻负担(借口双关语)。



最后(来自我)有一个名为 Cedar [ ^ ] - 可能值得查看有关该主题的出版物
Scott Mitchell has written a series of articles on creating dynamic, data-driven UI - see http://aspnet.4guysfromrolla.com/articles/082008-1.aspx[^]. It's for webforms but the principles can be applied to WinForms too.

There is also an MS Article[^] - again Web based but some useful stuff in there

I'm assuming that you are comfortable dynamically adding controls to a form via code but just in case (and for anyone else stumbling across this) there is a tutorial here[^]

Another technique I've seen used was to have pre-built forms but the data to determine the actual one that could be loaded was based on a role table. There was a sort of "controller" class that was called with form "alias" which would either show the form required or show a generic "You can't do this" form as required. Sorry the details are a bit vague but it was a long time ago and it was written in an old form of VB that shall remain nameless.

There is a commercial CRM product that stores ALL of it's UI definitions in a database - and I mean all! The "form" or parts of forms were generated at run-time from all that information. As you can imagine, sometimes it could be quite slow to navigate around. But that was mitigated by keeping the forms simple. If you have "fixed" areas then that would ease the load (excuse the pun).

Finally (from me) there is an Open University research program called Cedar[^] - might be worth having a look through their publications on the subject


这篇关于如何根据用户特定角色加载UI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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