Skip to content

Commit

Permalink
fix: Support for loadIncrementalFilteredPolicy
Browse files Browse the repository at this point in the history
Signed-off-by: MRGUOKING <420919469@qq.com>

Support for loadIncrementalFilteredPolicy

Signed-off-by: MRGUOKING <420919469@qq.com>
  • Loading branch information
MRGUOKING committed Jun 12, 2021
1 parent bb67ef6 commit 72c2001
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/coreEnforcer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,16 @@ export class CoreEnforcer {
public async loadFilteredPolicy(filter: any): Promise<boolean> {
this.model.clearPolicy();

return this.loadIncrementalFilteredPolicy(filter);
}

/**
* LoadIncrementalFilteredPolicy append a filtered policy from file/database.
*
* @param filter the filter used to specify which type of policy should be appended.
*/
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
public async loadIncrementalFilteredPolicy(filter: any): Promise<boolean> {
if ('isFiltered' in this.adapter) {
await this.adapter.loadFilteredPolicy(this.model, filter);
} else {
Expand Down

0 comments on commit 72c2001

Please sign in to comment.