[authorize(roles =" Admin"] v / s [authorize(users =" Admin"]] [英] [authorize(roles="Admin"] v/s [authorize(users="Admin"]

查看:89
本文介绍了[authorize(roles =" Admin"] v / s [authorize(users =" Admin"]]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



请解释这两个陈述的区别是什么......

1. [authorize(roles =Admin]

2. [authorize(users =Admin)



任何帮助都会被赞赏。



提前致谢

Hi,
Please explain what''s the difference b/w these 2 statements..
1. [authorize(roles="Admin"]
2. [authorize(users="Admin"]

any help would be appereciated.

Thanks in advance

推荐答案

您好,



您必须了解角色有点像一组用户(如在Active Directory中),用户就像用户一样。



例如,你可以有一个名为Admin的用户,他是网站管理员,然后您的用户被授予管理员权限,在这种情况下,他们的用户名将是某人,但他们将具有管理员角色,因此被授予访问权限ressource。



我知道这可能令人困惑,但你必须明白,在用户名和角色(或组成员资格)之间存在差异。< br $> b $ b



希望我的精液ts会帮助你。
Hello,

You have to understand tha a "Role" is kind of like a group of users (as in Active Directory), and that "User" is jus the user as itself.

As an example, you can have a user named "Admin" who is the site administrator, then you have users being granted administrator privileges and in that case their username will be "someone" but they will have the "Admin" role and as such be granted access to the ressource.

I know that can be confusing, but you really have to understand that the diffenrece is being made between a username and a role (or group membership).


Hope my comments will help you.


这篇关于[authorize(roles =&quot; Admin&quot;] v / s [authorize(users =&quot; Admin&quot;]]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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