-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User routes correctly protected. Added initialisation values to database. Added dev routes to get all values. => ! Route publicuser/new is not protected yet <=
- Loading branch information
1 parent
1e67090
commit cf9ea61
Showing
4 changed files
with
145 additions
and
18 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
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 |
---|---|---|
|
@@ -6,7 +6,116 @@ INSERT INTO roles (roleName, canUsePrivate, canModerate, canArchive, canInvite, | |
VALUES ("admin", true, true, true, true, true, true); | ||
|
||
INSERT INTO roles (roleName, canUsePrivate, canModerate, canArchive, canInvite, canManage, canManageUser) | ||
VALUES ("standart", true, true, true, false, false, false); | ||
VALUES ("standard", true, true, true, false, false, false); | ||
|
||
INSERT INTO roles (roleName, canUsePrivate, canModerate, canArchive, canInvite, canManage, canManageUser) | ||
VALUES ("guest", false, false, false, false, false, false); | ||
VALUES ("guest", false, false, false, false, false, false); | ||
|
||
-- CHANNEL INITIALISATION ------------------------------------------------------------------------ | ||
INSERT INTO channels (webId, channelName, type, lastUpdate, private, avatar, description, subject) | ||
VALUES ("generaltextchannel", "general", "text", 1, false, "defaultAvatar", "Speak on general subjects", "General"); | ||
|
||
INSERT INTO channels (webId, channelName, type, lastUpdate, private, avatar,description) | ||
VALUES ("randomtextchannel", "random", "text", 1, false, "defaultAvatar","Speak about any thing"); | ||
|
||
INSERT INTO channels (webId, channelName, type, lastUpdate, private, avatar) | ||
VALUES ("generalvocchannel", "general - voc", "audio", 1, false, "defaultAvatar"); | ||
|
||
INSERT INTO channels (webId, channelName, type, lastUpdate, private, avatar) | ||
VALUES ("randomvocchannel", "random - voc", "audio", 1, false, "defaultAvatar"); | ||
|
||
INSERT INTO channels (webId, channelName, type, lastUpdate, private, avatar) | ||
VALUES ("generalvidchannel", "general - vid", "video", 1, false, "defaultAvatar"); | ||
|
||
INSERT INTO channels (webId, channelName, type, lastUpdate, private, avatar) | ||
VALUES ("randomvidchannel", "random - vid", "video", 1, false, "defaultAvatar"); | ||
|
||
-- PARMETER INITIALISATION ------------------------------------------------------------------------ | ||
INSERT INTO parameters (local, timeZone) | ||
VALUES ("en_EN", "UTC-1"); | ||
|
||
-- UNCOMMENT THE FOLLOWINGS FOR LOCAL DEV TEST --------------------------------------------------- | ||
|
||
-- USER INITIALISATION <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
INSERT INTO users (webId, userName, email, lastUpdate, password, idRole, avatar, nickName, firstName, lastName) | ||
VALUES ("TestUserOwner", "devowner", "[email protected]", 1105154015461, "$2a$10$IU8oU9dseYZytHcr54VXj.H9tX78hS2xUuPrzMeVN6rFG7k89i6EW", 1, "user/owned.svg", "owner", "owner", "dev"); | ||
|
||
|
||
INSERT INTO users (webId, userName, email, lastUpdate, password, idRole, avatar, nickName, firstName, lastName) | ||
VALUES ("TestUserAdmin", "devadmin", "[email protected]", 1105154015461, "$2a$10$IU8oU9dseYZytHcr54VXj.H9tX78hS2xUuPrzMeVN6rFG7k89i6EW", 2, "user/avatar.svg", "admin", "admin", "dev"); | ||
|
||
INSERT INTO users (webId, userName, email, lastUpdate, password, idRole, avatar, nickName, firstName, lastName) | ||
VALUES ("TestUserStandard", "devstandard", "[email protected]", 1105154015461, "$2a$10$IU8oU9dseYZytHcr54VXj.H9tX78hS2xUuPrzMeVN6rFG7k89i6EW", 3, "user/avatar.svg", "standard", "standard", "dev"); | ||
|
||
INSERT INTO users (webId, userName, email, lastUpdate, password, idRole, avatar, nickName, firstName, lastName) | ||
VALUES ("TestUserGuest", "devguest", "[email protected]", 1105154015461, "$2a$10$IU8oU9dseYZytHcr54VXj.H9tX78hS2xUuPrzMeVN6rFG7k89i6EW", 4, "user/avatar.svg", "guest", "guest", "dev"); | ||
|
||
-- ORGANISATION INITIALISATION <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
INSERT INTO organisations (dockerStack, organisationName, description, avatar, domain) | ||
VALUES (1, "Popcube Dev", "Test for popcube", "popcube.svg", "popcubedev.popbcube.xyz"); | ||
|
||
-- MEMBERS INITITIALISATION <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
INSERT INTO members (idUser, idChannel) | ||
VALUES (1, 1); | ||
INSERT INTO members (idUser, idChannel) | ||
VALUES (2, 1); | ||
INSERT INTO members (idUser, idChannel) | ||
VALUES (3, 1); | ||
INSERT INTO members (idUser, idChannel) | ||
VALUES (4, 1); | ||
|
||
INSERT INTO members (idUser, idChannel) | ||
VALUES (1, 2); | ||
INSERT INTO members (idUser, idChannel) | ||
VALUES (2, 2); | ||
INSERT INTO members (idUser, idChannel) | ||
VALUES (3, 2); | ||
INSERT INTO members (idUser, idChannel) | ||
VALUES (4, 2); | ||
|
||
INSERT INTO members (idUser, idChannel) | ||
VALUES (1, 3); | ||
INSERT INTO members (idUser, idChannel, idRole) | ||
VALUES (2, 3,3); | ||
INSERT INTO members (idUser, idChannel) | ||
VALUES (3, 3); | ||
INSERT INTO members (idUser, idChannel) | ||
VALUES (4, 3); | ||
|
||
INSERT INTO members (idUser, idChannel) | ||
VALUES (1, 4); | ||
INSERT INTO members (idUser, idChannel) | ||
VALUES (2, 4); | ||
INSERT INTO members (idUser, idChannel, idRole) | ||
VALUES (3, 4, 2); | ||
INSERT INTO members (idUser, idChannel) | ||
VALUES (4, 4); | ||
|
||
-- MESSAGE INITIALISATION <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
INSERT INTO messages (idUser, idChannel, date, content) | ||
VALUES (1, 1, 10210541, "Test message."); | ||
INSERT INTO messages (idUser, idChannel, date, content) | ||
VALUES (1, 1, 10210542, ""); | ||
INSERT INTO messages (idUser, idChannel, date, content) | ||
VALUES (1, 1, 10210543, "Test message with folder."); | ||
|
||
-- FOLDER INITIALISATION <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
INSERT INTO folders (idMessage, type, link, name) | ||
VALUES (2, "txt", "folders/text.txt", "text"); | ||
|
||
INSERT INTO folders (idMessage) | ||
VALUES (3); | ||
|
||
-- EMOJIS INITIALISATION <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
INSERT INTO emojis (name, shortcut, link) | ||
VALUE ("troll face", ":troll:", "emojis/troll.svg"); | ||
|
||
INSERT INTO emojis (name, shortcut, link) | ||
VALUE ("love", "<3", "emojis/love.svg"); | ||
|
||
-- AVATARS INITIALISATION <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
INSERT INTO avatars (name, link) | ||
VALUE ("troll face", "emojis/troll.svg"); | ||
|
||
INSERT INTO avatars (name, link) | ||
VALUE ("Strawberrie", "emojis/straw.svg"); |