mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 10:07:55 +08:00
- PERF: Fix the role based auth service to not recalculate permission checks again and again.
- Adding some comments to the authorization event handler interface. --HG-- branch : dev
This commit is contained in:
@@ -84,6 +84,8 @@ namespace Orchard.Roles.Services {
|
||||
|
||||
context.Adjusted = false;
|
||||
_authorizationServiceEventHandler.Adjust(context);
|
||||
if (!context.Adjusted)
|
||||
break;
|
||||
}
|
||||
|
||||
_authorizationServiceEventHandler.Complete(context);
|
||||
|
@@ -13,7 +13,12 @@ namespace Orchard.Security {
|
||||
public Permission Permission { get; set; }
|
||||
public IUser User { get; set; }
|
||||
public IContent Content { get; set; }
|
||||
|
||||
// true if the permission has been granted to the user.
|
||||
public bool Granted { get; set; }
|
||||
|
||||
// if context.Permission was modified during an Adjust(context) in an event handler, Adjusted should be set to true.
|
||||
// It means that the permission check will be done again by the framework.
|
||||
public bool Adjusted { get; set; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user