|
25 | 25 | #include "./enforcer.h" |
26 | 26 | #include "./persist/watcher_ex.h" |
27 | 27 | #include "./persist/file_adapter/file_adapter.h" |
| 28 | +#include "./persist/file_adapter/batch_file_adapter.h" |
28 | 29 | #include "./rbac/default_role_manager.h" |
29 | 30 | #include "./effect/default_effector.h" |
30 | 31 | #include "./exception/casbin_adapter_exception.h" |
@@ -179,7 +180,7 @@ Enforcer ::Enforcer() { |
179 | 180 | * @param policyFile the path of the policy file. |
180 | 181 | */ |
181 | 182 | Enforcer ::Enforcer(const std::string& model_path, const std::string& policy_file) |
182 | | - : Enforcer(model_path, std::make_shared<FileAdapter>(policy_file)) { |
| 183 | + : Enforcer(model_path, std::make_shared<BatchFileAdapter>(policy_file)) { |
183 | 184 | } |
184 | 185 |
|
185 | 186 | /** |
@@ -233,14 +234,14 @@ Enforcer ::Enforcer(const std::string& model_path): Enforcer(model_path, "") { |
233 | 234 | * @param enableLog whether to enable Casbin's log. |
234 | 235 | */ |
235 | 236 | Enforcer::Enforcer(const std::string& model_path, const std::string& policy_file, bool enable_log) |
236 | | - : Enforcer(model_path, std::make_shared<FileAdapter>(policy_file)) { |
| 237 | + : Enforcer(model_path, std::make_shared<BatchFileAdapter>(policy_file)) { |
237 | 238 | this->EnableLog(enable_log); |
238 | 239 | } |
239 | 240 |
|
240 | 241 |
|
241 | 242 | // InitWithFile initializes an enforcer with a model file and a policy file. |
242 | 243 | void Enforcer::InitWithFile(const std::string& model_path, const std::string& policy_path) { |
243 | | - std::shared_ptr<Adapter> a = std::make_shared<FileAdapter>(policy_path); |
| 244 | + std::shared_ptr<Adapter> a = std::make_shared<BatchFileAdapter>(policy_path); |
244 | 245 | this->InitWithAdapter(model_path, a); |
245 | 246 | } |
246 | 247 |
|
|
0 commit comments