Skip to content

Commit

Permalink
schema: unique privilege codes and add default privileges
Browse files Browse the repository at this point in the history
  • Loading branch information
TyIsI committed Dec 1, 2024
1 parent 34503e3 commit ae2cae9
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
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 migrations/28/V28.1733087966946__Add_standard_privileges.sql
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;

0 comments on commit ae2cae9

Please sign in to comment.