怎样避免使用会员的供应商? [英] How to avoid using membership provider?

查看:106
本文介绍了怎样避免使用会员的供应商?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在建设架构瘦客户端应用程序记账。它应该遵循两个主要要求:

We are currently building architecture for thin-client bookkeeping application. It should follow two main requirements:


  1. 应用程序应该有模块的设计。每个模块都可以有(而且他们实际上确实有)自己的角色系统。

  2. 以后的应用中应适应于不同的计算机上使用不同的数据库上运行。

我们认为Asp.NET MVC 3是这个任务的合适平台。用于管理应用程序的数据,我们选择了最新版本的实体框架 - 它的批量数据提供者和code首先功能可以为我们节省很多时间。

We think Asp.NET MVC 3 is appropriate platform for this task. For managing application data we chosen latest version of Entity Framework - its batch of Data Providers and Code First feature can save us much time.

我们正在纠结的部分是用户/角色管理系统。我们应该有某种形式的全球管理部分的添加用户,并给予他们访问模块(全球唯一管理员可以添加用户到系统中,没有家伙从街注册支持),每个模块都有自己的管理员自身的管理部分和角色。我们已经拥有的数据模型来存储我们需要适当的方式的一切,但不知道如何从应用程序正确地访问这些数据。

The part we are tangled with is user/role management system. We should have some kind of Global Administration section for adding users and giving them access to modules (only global admins can add user to the system, no "guy from street" registration supported) and each module has its own administration section with its own admins and roles. We already have data model to store everything we need in appropriate way but have no idea how to access this data correctly from application.

目前,我们看到解决这个问题的两种可能的方式:

Currently we see two possible ways to resolve this problem:


  1. 要编写基于我们的DAL自定义成员资格和角色提供。从我们的团队没人以前,所以我们如果这种方式值得的麻烦不知道这样做。因为应用程序需要,因此我们将需要一些仰卧起坐会员供应商不能提供尽可能多的灵活性。

  2. 要通过一些过时的书籍挖掘,找出网站管理系统是如何创建的地方供应商会员组织之前

这两种方式是不优雅,对我们和它不是一个简单的问题哪种方式来选择并不明显。此外,我们相信,它可以是其他的解决办法(事业结构可能会受到影响)。因此,我们很高兴地看到连接到这个问题的任何建议。

Both this ways are not elegant and not obvious for us and its not an easy question which way to choose. Also we do believe that it can be other solution (of cause architecture can be affected). So, we would be glad to see any suggestion connected to this problem.

推荐答案

好了,终于我们决定一切从头写,这是比较容易,这似乎是

Well, finally we decided write all from scratch and it was easier that it seemed to be


  • 添加自己的IPrincipal实现。附加字段和IsInRole()方法来避免编写自己的属性完全不同的逻辑。

  • 分配我们的IPrincipal在Global.ajax事件的用户。

它在所有wasn`t努力。现在,我们拥有所有我们想要的灵活性。没有供应商参与进来。

It wasn`t hard at all. Now we have all the flexibility we wanted. No providers involved.

这篇关于怎样避免使用会员的供应商?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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