Aller au contenu principal
Version: Next

TypeORMAdapter

TypeORMAdapter represents the TypeORM filtered adapter for policy storage.

Hierarchy

  • BaseAdapter<GenericCasbinRule>
    • TypeORMAdapter

Index

Constructors

constructor

  • new TypeORMAdapter(dataSource: DataSource, options: TypeORMAdapterConfig): TypeORMAdapter

Methods

addPolicy

  • addPolicy(sec: string, ptype: string, rule: string[]): Promise<void>

isFiltered

  • isFiltered(): boolean

loadFilteredPolicy

  • loadFilteredPolicy(model: Model, filter: any): Promise<void>

loadPolicy

  • loadPolicy(model: Model): Promise<void>

removeFilteredPolicy

  • removeFilteredPolicy(sec: string, ptype: string, fieldIndex: number, ...fieldValues: string[]): Promise<void>

removePolicy

  • removePolicy(sec: string, ptype: string, rule: string[]): Promise<void>

savePolicy

  • savePolicy(model: Model): Promise<boolean>