mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 18:47:55 +08:00
全面修正分级授权,去掉Anonymous,采用Authenticate进行授权
This commit is contained in:
@@ -46,10 +46,10 @@ namespace OpenAuth.Mvc.Controllers
|
||||
if (function == null)
|
||||
throw new Exception("未能找到Action");
|
||||
|
||||
var anonymous = function.GetCustomAttribute(typeof(AnonymousAttribute));
|
||||
var authorize = function.GetCustomAttribute(typeof(AuthenticateAttribute));
|
||||
var module = loginUser.Modules.FirstOrDefault(u => u.Url.ToLower().Contains(controllername));
|
||||
//当前登录用户没有Action记录&&Action没有anonymous标识
|
||||
if (module == null && anonymous == null)
|
||||
if (authorize != null && module == null)
|
||||
{
|
||||
filterContext.Result = new RedirectResult("/Login/Index");
|
||||
return;
|
||||
|
Reference in New Issue
Block a user