-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #466 from curveball/all-principal
Adding a special group principal $all
- Loading branch information
Showing
12 changed files
with
158 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,6 @@ inspect: build | |
|
||
inspect-brk: build | ||
node --inspect-brk dist/app.js | ||
|
||
src/db-types.js: | ||
./bin/generate-db-types.mjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Knex } from 'knex'; | ||
|
||
|
||
export async function up(knex: Knex): Promise<void> { | ||
|
||
await knex.schema.alterTable('principals', table => { | ||
|
||
table | ||
.tinyint('system') | ||
.notNullable() | ||
.defaultTo(0) | ||
.comment('System principals are built-in and cannot be deleted'); | ||
|
||
}); | ||
|
||
await knex('principals').insert({ | ||
identity: 'urn:uuid:5793d1ce-d21e-4955-9091-c2b9debb9ec1', | ||
nickname: 'All Users', | ||
created_at: Date.now(), | ||
active: 1, | ||
type: 3, // Group | ||
modified_at: Date.now(), | ||
external_id: '$all', | ||
system: 1, | ||
}); | ||
|
||
} | ||
|
||
|
||
export async function down(knex: Knex): Promise<void> { | ||
|
||
throw new Error('Reverting this migration is not supported.'); | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.