Skip to content

basalt / permissions/src / MemoryAccessStore

Class: MemoryAccessStore ​

Defined in: permissions/src/index.ts:226

Where grants live — the app's database in production. scope is the tenant id or GLOBAL_SCOPE, making every grant tenant-scoped by default.

Implements ​

Constructors ​

Constructor ​

> new MemoryAccessStore(): MemoryAccessStore

Returns ​

MemoryAccessStore

Methods ​

assignRole() ​

> assignRole(userId, role, scope): Promise<void>

Defined in: permissions/src/index.ts:249

Parameters ​

userId ​

string

role ​

string

scope ​

string

Returns ​

Promise<void>

Implementation of ​

AccessStore.assignRole


getRolePermissions() ​

> getRolePermissions(role, scope): Promise<string[]>

Defined in: permissions/src/index.ts:245

Parameters ​

role ​

string

scope ​

string

Returns ​

Promise<string[]>

Implementation of ​

AccessStore.getRolePermissions


getUserPermissions() ​

> getUserPermissions(userId, scope): Promise<string[]>

Defined in: permissions/src/index.ts:241

Parameters ​

userId ​

string

scope ​

string

Returns ​

Promise<string[]>

Implementation of ​

AccessStore.getUserPermissions


getUserRoles() ​

> getUserRoles(userId, scope): Promise<string[]>

Defined in: permissions/src/index.ts:237

Parameters ​

userId ​

string

scope ​

string

Returns ​

Promise<string[]>

Implementation of ​

AccessStore.getUserRoles


grantToRole() ​

> grantToRole(role, permissions, scope): Promise<void>

Defined in: permissions/src/index.ts:262

Parameters ​

role ​

string

permissions ​

string[]

scope ​

string

Returns ​

Promise<void>

Implementation of ​

AccessStore.grantToRole


grantToUser() ​

> grantToUser(userId, permissions, scope): Promise<void>

Defined in: permissions/src/index.ts:270

Parameters ​

userId ​

string

permissions ​

string[]

scope ​

string

Returns ​

Promise<void>

Implementation of ​

AccessStore.grantToUser


removeRole() ​

> removeRole(userId, role, scope): Promise<void>

Defined in: permissions/src/index.ts:258

Parameters ​

userId ​

string

role ​

string

scope ​

string

Returns ​

Promise<void>

Implementation of ​

AccessStore.removeRole

Released under the MIT License.