拒绝用户特定视图?
我有 mvc2 项目,我创建了自定义角色提供程序,我正在使用属性 [Authorize(Roles = "Admin")] 来防止授权用户执行某些操作 总是拒绝用户登录视图我想更改它并重定向用户以查看我正在告诉他他无权执行此操作
[Authorize(Roles = "Admin")]
public ActionResult delete(int id)
{
...........
}
i have mvc2 project and i make custom role Provider I'm using attributes [Authorize(Roles = "Admin")] to prevent an authorized user from doing some actions
that always reject user to log in view i want to change that and redirect user to view that I'm tilling him that he isn't authorized for this action
[Authorize(Roles = "Admin")]
public ActionResult delete(int id)
{
...........
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个反复出现的问题:
此处 此处
This is a recurring question:
Here & Here