-
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add imports and batchFileAdapter implementation.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { FileAdapter } from './fileAdapter'; | ||
import { BatchAdapter } from './batchAdapter'; | ||
|
||
/** | ||
* FileAdapter is the file adapter for Casbin. | ||
* It can load policy from file or save policy to file. | ||
*/ | ||
export class BatchFileAdapter extends FileAdapter implements BatchAdapter { | ||
/** | ||
* FileAdapter is the constructor for FileAdapter. | ||
* @param {string} filePath filePath the path of the policy file. | ||
*/ | ||
constructor(filePath: string) { | ||
super(filePath); | ||
} | ||
|
||
// addPolicies adds policy rules to the storage. | ||
// This is part of the Auto-Save feature. | ||
public async addPolicies(sec: string, ptype: string, rules: string[][]): Promise<void> { | ||
throw new Error('not implemented'); | ||
} | ||
|
||
// removePolicies removes policy rules from the storage. | ||
// This is part of the Auto-Save feature. | ||
public async removePolicies(sec: string, ptype: string, rules: string[][]): Promise<void> { | ||
throw new Error('not implemented'); | ||
} | ||
} |
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