-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #295 from AsakusaRinne/add_auto_load_policy_preview
feat: change lazyLoadPolicy to AutoLoadPolicy.
- Loading branch information
Showing
6 changed files
with
70 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
using Casbin.Model; | ||
using System; | ||
using Casbin.Model; | ||
using Casbin.Persist; | ||
|
||
namespace Casbin | ||
{ | ||
public static class DefaultEnforcer | ||
{ | ||
public static IEnforcer Create(IReadOnlyAdapter adapter = null, bool lazyLoadPolicy = false) | ||
public static IEnforcer Create(IReadOnlyAdapter adapter = null, Action<IEnforcer.EnforcerOptions> optionSettings = null) | ||
{ | ||
return new Enforcer(DefaultModel.Create(), adapter, lazyLoadPolicy); | ||
return new Enforcer(DefaultModel.Create(), adapter, optionSettings); | ||
} | ||
|
||
public static IEnforcer Create(string modelPath, string policyPath, bool lazyLoadPolicy = false) | ||
public static IEnforcer Create(string modelPath, string policyPath, Action<IEnforcer.EnforcerOptions> optionSettings = null) | ||
{ | ||
return new Enforcer(modelPath, policyPath, lazyLoadPolicy); | ||
return new Enforcer(modelPath, policyPath, optionSettings); | ||
} | ||
|
||
public static IEnforcer Create(string modelPath, IReadOnlyAdapter adapter = null, bool lazyLoadPolicy = false) | ||
public static IEnforcer Create(string modelPath, IReadOnlyAdapter adapter = null, Action<IEnforcer.EnforcerOptions> optionSettings = null) | ||
{ | ||
return new Enforcer(modelPath, adapter, lazyLoadPolicy); | ||
return new Enforcer(modelPath, adapter, optionSettings); | ||
} | ||
|
||
public static IEnforcer Create(IModel model, IReadOnlyAdapter adapter = null, bool lazyLoadPolicy = false) | ||
public static IEnforcer Create(IModel model, IReadOnlyAdapter adapter = null, Action<IEnforcer.EnforcerOptions> optionSettings = null) | ||
{ | ||
return new Enforcer(model, adapter, lazyLoadPolicy); | ||
return new Enforcer(model, adapter, optionSettings); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters