7c16abc8eb
* feat(workspaces): add workspaces module with roles and scopes * feat(workspaces): add domain, graphql and persistent storage dataschema * fix(workspaces): correct db injections * chore(workspaces): add EE license * chore(license): mentions workspaces separately in license file * fix(core): roles import in migration * fix(workspaces): drop workspace_acl on down migration * fix(workspaces): roles constants * fix(workspaces): coding standards --------- Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
9 lines
324 B
TypeScript
9 lines
324 B
TypeScript
import { TokenScopeData } from '@/modules/shared/domain/rolesAndScopes/types'
|
|
import { Knex } from 'knex'
|
|
|
|
export const registerOrUpdateScopeFactory =
|
|
({ db }: { db: Knex }) =>
|
|
async ({ scope }: { scope: TokenScopeData }) => {
|
|
await db('scopes').insert(scope).onConflict('name').merge(['public', 'description'])
|
|
}
|