-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schema: unique privilege codes and add default privileges
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
migrations/28/V28.1733087920185__Enforce_unique_codes_in_privileges_table.sql
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,8 @@ | ||
SET | ||
SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | ||
|
||
START TRANSACTION; | ||
|
||
ALTER TABLE `privileges` ADD UNIQUE (`code`); | ||
|
||
COMMIT; |
42 changes: 42 additions & 0 deletions
42
migrations/28/V28.1733087966946__Add_standard_privileges.sql
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,42 @@ | ||
SET | ||
SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | ||
|
||
START TRANSACTION; | ||
|
||
INSERT IGNORE INTO `privileges` (name, description, code, enabled) | ||
VALUES | ||
( | ||
'Edit Full Profile', | ||
'Permission to edit all profile fields', | ||
'full-profile', | ||
1 | ||
); | ||
|
||
INSERT IGNORE INTO `privileges` (name, description, code, enabled) | ||
VALUES | ||
( | ||
'Web Hook Service', | ||
'Service privilege for webhooker', | ||
'webhook', | ||
1 | ||
); | ||
|
||
INSERT IGNORE INTO `privileges` (name, description, code, enabled) | ||
VALUES | ||
( | ||
'OAuth Provider', | ||
'OAuth Provider Privilege', | ||
'oauth', | ||
1 | ||
); | ||
|
||
INSERT IGNORE INTO `privileges` (name, description, code, enabled) | ||
VALUES | ||
( | ||
'Generate Temporary Pins', | ||
'This privilege would allow users to generate temporary pins.', | ||
'gen-temp-pin', | ||
0 | ||
); | ||
|
||
COMMIT; |