请任何人帮我 [英] Please anyone help me

查看:67
本文介绍了请任何人帮我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Windows应用程序.这里我面临的问题是每个用户都有角色.每个角色的菜单显示取决于角色,请帮助我

I am developing windows application.Here i facing the problem is each user have role.each role have different menu display depend on the role,please help me

推荐答案

即使这不是一个问题,也不是一个糟糕,非常糟糕的问题,但我只想给你一个主意.

可能大多数人在角色设计上都会犯很大的错误.他们尝试描绘诸如管理员",开发人员",工程师",最终用户",操作员"之类的角色,并尝试将一些访问权限和功能与其相关联.

原则上,这是错误的方法.不同的组织甚至不同的专业人员对角色都有不同的看法,只是因为他们以不同的方式描绘了作品的组织.也许,您甚至不必关心那些角色,而将其留给客户.怎么样?

设计应从您的应用程序开始.从用户的角度来看,您应该将应用程序的工作分为几个活动.有些可以允许,有些则不允许.您应该对它们进行分类,即使不允许进行其他活动,也要使每个活动都具有充分的意义.

制作一些管理应用程序,使您的客户能够介绍自己的角色,并将每个角色与该角色可用的一个或多个活动相关联.正是这样:多对多的关系.首先,介绍用户列表,并将用户与一个角色相关联(许多角色是可选的,因为角色本身足够灵活).

留给客户;让他们发明"任何可想到的角色及其名称.这将使他们更多地感受到自己的重要性( SOI :-))ans将使您免于不必要的头痛.



请查看Thatraja的答案.在我的评论中,我根据他的例子阐明了我的概念.请参阅.

—SA
Even though this is not a question and a poorly, very poorly formulated problem, I want to just give you one idea.

Probably most people do a big mistake in design of the roles. They try to picture the roles such as "administrator", "developer", "engineer", "end user", "operator" and try to associate some access and functionality with them.

This is a wrong approach in principle. Different organizations and even different professionals can have different views on the roles, just because they picture the organization of works in different ways. Maybe, you should not even care about those roles and leave them to customer. How?

The design should start with your application. You should classify the work with your applications into several activities from the user point of view. Some can be allowed, some are not. You should classify them the way each activity would make full sense even if other activities are not allowed.

Make some administrative application which enable your customer to introduce their own roles and associate each role with one or more activities available to this role. Exactly in this way: a many-to-many relationship. On top of it, introduce the list of users, and associate a user with one role (many roles are optional because the roles themselves are flexible enough).

Leave it to the customers; let them "invent" any thinkable roles and their name. It will give them more of that Sense of Own Importance (SOI :-)) ans will save you from unwanted headache.



Please see the answer by thatraja. In my comment, I''ve clarified my conception based on his example. Please see.

—SA


您需要根据用户权限过滤数据源.

考虑以下选项...

选项
添加数据
编辑数据
查看数据
删除数据
打印数据



用户类型
管理员用户
普通用户


如果用户是管理员用户,则允许所有选项.如果用户普通用户" 则限制了某些选项(例如删除",打印"),因此请过滤数据源.


选项(对于普通用户)
添加数据
编辑数据
查看数据


供您参考

如何在ASP.NET(C#)中创建数据库驱动菜单 [ ^ ]
You need to filter the datasource based on user rights.

Consider the below options...

Options
Add Data
Edit Data
View Data
Delete Data
Print Data



User Type
Admin User
Normal User


If the user is Admin User then allow all options. If the user Normal User then restrict some options(Like Delete, Print) so filter the datasource.


Options (For Normal User)
Add Data
Edit Data
View Data


For your information

How To Create Database Driven Menu in ASP.NET (C#)[^]


简而言之,您将需要在数据库中存储每个用户的角色,并根据登录ID提取角色.
加载角色后,您将根据这些角色启用UI的禁用部分.
Briefly, you will need to store roles for each user in the database and based on the login id fetch them.
Once the roles are loaded, you will enable disable parts of your UI based on these roles.


这篇关于请任何人帮我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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