Sequelize Guard
API ReferenceInterfaces

Interface: GuardOptions

sequelize-guard v6.0.1


sequelize-guard / GuardOptions

Interface: GuardOptions

Defined in: types/options.ts:7

Configuration options for SequelizeGuard

Properties

tables?

optional tables: object

Defined in: types/options.ts:11

Table names configuration

meta?

optional meta: string

parents?

optional parents: string

permissions?

optional permissions: string

resources?

optional resources: string

roles?

optional roles: string

users?

optional users: string


prefix?

optional prefix: string

Defined in: types/options.ts:24

Prefix for guard tables in database

Default

'guard_'

primaryKey?

optional primaryKey: string

Defined in: types/options.ts:30

Primary key for guard tables

Default

'id'

timestamps?

optional timestamps: boolean

Defined in: types/options.ts:36

Add timestamps to tables

Default

false

paranoid?

optional paranoid: boolean

Defined in: types/options.ts:42

Enable soft deletes of items

Default

false

sync?

optional sync: boolean

Defined in: types/options.ts:48

Auto create tables, set to false if using migrations

Default

true

debug?

optional debug: boolean

Defined in: types/options.ts:54

Debug mode, output logs

Default

false

UserModel?

optional UserModel: ModelStatic<GuardUserModel> | null

Defined in: types/options.ts:60

Model used for User (pass model, not string name)

Default

null

userPk?

optional userPk: string

Defined in: types/options.ts:66

Primary key used for User Model

Default

'id'

safeGuardDeletes?

optional safeGuardDeletes: boolean

Defined in: types/options.ts:72

Roles or permissions can't be deleted while associated with other data

Default

true

userCache?

optional userCache: boolean

Defined in: types/options.ts:78

Cache user roles for faster permission resolution

Default

true

userCacheTtl?

optional userCacheTtl: number

Defined in: types/options.ts:84

Time to cache user roles (in seconds)

Default

60

On this page