casbin
Version:
An authorization library that supports access control models like ACL, RBAC, ABAC in Node.JS
47 lines (46 loc) • 2.83 kB
TypeScript
import { CoreEnforcer } from './coreEnforcer';
/**
* InternalEnforcer = CoreEnforcer + Internal API.
*/
export declare class InternalEnforcer extends CoreEnforcer {
/**
* addPolicyInternal adds a rule to the current policy.
*/
protected addPolicyInternal(sec: string, ptype: string, rule: string[], useWatcher: boolean): Promise<boolean>;
protected addPoliciesInternal(sec: string, ptype: string, rules: string[][], useWatcher: boolean): Promise<boolean>;
/**
* addPoliciesInternalEx adds rules to the current policy.
* Unlike addPoliciesInternal, this method will filter out rules that already exist
* and continue to add the remaining rules instead of returning false immediately.
*/
protected addPoliciesInternalEx(sec: string, ptype: string, rules: string[][], useWatcher: boolean): Promise<boolean>;
/**
* updatePolicyInternal updates a rule from the current policy.
*/
protected updatePolicyInternal(sec: string, ptype: string, oldRule: string[], newRule: string[], useWatcher: boolean): Promise<boolean>;
/**
* removePolicyInternal removes a rule from the current policy.
*/
protected removePolicyInternal(sec: string, ptype: string, rule: string[], useWatcher: boolean): Promise<boolean>;
protected removePoliciesInternal(sec: string, ptype: string, rules: string[][], useWatcher: boolean): Promise<boolean>;
/**
* removeFilteredPolicyInternal removes rules based on field filters from the current policy.
*/
protected removeFilteredPolicyInternal(sec: string, ptype: string, fieldIndex: number, fieldValues: string[], useWatcher: boolean): Promise<boolean>;
/**
* get field index in model.fieldMap.
*/
getFieldIndex(ptype: string, field: string): number;
/**
* set index of field
*/
setFieldIndex(ptype: string, field: string, index: number): void;
protected addPolicyWithoutNotify(sec: string, ptype: string, rule: string[]): Promise<boolean>;
protected addPoliciesWithoutNotify(sec: string, ptype: string, rules: string[][]): Promise<boolean>;
protected addPoliciesWithoutNotifyEx(sec: string, ptype: string, rules: string[][]): Promise<boolean>;
protected updatePolicyWithoutNotify(sec: string, ptype: string, oldRule: string[], newRule: string[]): Promise<boolean>;
protected removePolicyWithoutNotify(sec: string, ptype: string, rule: string[]): Promise<boolean>;
protected removePoliciesWithoutNotify(sec: string, ptype: string, rules: string[][]): Promise<boolean>;
protected removeFilteredPolicyWithoutNotify(sec: string, ptype: string, fieldIndex: number, fieldValues: string[]): Promise<boolean>;
protected updatePoliciesWithoutNotify(sec: string, ptype: string, oldRules: string[][], newRules: string[][]): Promise<boolean>;
}