如何使用ASP.NET MVC为我的crm应用程序中的deffierent用户设置授权 [英] How can I set authorization for deffierent users in my crm application with ASP.NET MVC

查看:107
本文介绍了如何使用ASP.NET MVC为我的crm应用程序中的deffierent用户设置授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我希望管理员在他自己的界面中通过电子邮件验证注册用户,我也希望第一个在我的database.schema(postgresql)中连接的人是管理员,我真的不知道如何做到这一点,我希望你真的能帮助我



我尝试过:



没什么。

解决方案

一种方法:



当第一个用户尝试时注册,如果没有注册用户是管理员,给他们输入第二个密码,以便他们成为管理员。此密码可以在数据库的表中生效(以加密形式),并且可以在dbcontext对象的表中播种。这样,有人必须已经知道管理员密码才能获得该角色。



另一种方式:



等到他们成为注册用户,并简单地创建另一个页面,让他们输入管理员用户密码。



另一种方式:



您可以禁止常规(非管理员)用户注册,直到有人注册知道管理员密码。此时,注册的第一个人将被分配管理员角色。


第一个用户将连接并成为管理员,然后他从他的个人资料/settings.aspx创建用户,他们收到一封随机密码的邮件,他们确认并连接到应用程序,管理员也可以进行他们无法修改或删除的CRUD操作,另一方面他可以修改删除并阅读他们所做的事情。解释

for example,i want that users be registered by the administrator in his own interface by email authentification,also i want that the first one who connects in my database.schema(postgresql) be the admin,i dont know really how to make it so i want you really to help me

What I have tried:

Nothing.

解决方案

One way to do it:

When the first user tries to register, and if there is no registered user that is the admin, give them a second password to enter that would allow them to be the admin. This password could be live (in encrypted form) in a table in the database, and could be seeded into the table in the dbcontext object. That way, someone would have to already know the admin password in order to get that role.

Another way:

Wait until they've become a registered user, and simply make another page available that lets them enter the admin user password.

Another way:

You could prohibit regular (non-admin) users from registering until someone has registered that knows the admin password. At that point, the first person that registers would be assigned the admin role.


firstable,the first user will connect and be admin,then he creates users from his profile /settings.aspx ,they receive a mail with a random password,they confirm and they connect to the app,also the admin can make CRUD operations that they cant modify or delete,in other hand he can modify delete and read what they do..sorry for my bad explanation


这篇关于如何使用ASP.NET MVC为我的crm应用程序中的deffierent用户设置授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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