UNPKG

casbin

Version:

An authorization library that supports access control models like ACL, RBAC, ABAC in Node.JS

42 lines (41 loc) 1.8 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchFileAdapter = void 0; const fileAdapter_1 = require("./fileAdapter"); /** * FileAdapter is the file adapter for Casbin. * It can load policy from file or save policy to file. */ class BatchFileAdapter extends fileAdapter_1.FileAdapter { /** * FileAdapter is the constructor for FileAdapter. * @param {string} filePath filePath the path of the policy file. */ constructor(filePath) { super(filePath); } // addPolicies adds policy rules to the storage. // This is part of the Auto-Save feature. addPolicies(sec, ptype, rules) { return __awaiter(this, void 0, void 0, function* () { throw new Error('not implemented'); }); } // removePolicies removes policy rules from the storage. // This is part of the Auto-Save feature. removePolicies(sec, ptype, rules) { return __awaiter(this, void 0, void 0, function* () { throw new Error('not implemented'); }); } } exports.BatchFileAdapter = BatchFileAdapter;