From acb6fe2c4b03df526322249e0b28640e1227fe38 Mon Sep 17 00:00:00 2001 From: jusax23 Date: Sat, 1 Apr 2023 09:55:46 +0200 Subject: [PATCH] renaming --- src/api/acts/roomContent.ts | 22 +++++++++++----------- src/server/permissions.ts | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/api/acts/roomContent.ts b/src/api/acts/roomContent.ts index c2a793c..3f72719 100644 --- a/src/api/acts/roomContent.ts +++ b/src/api/acts/roomContent.ts @@ -62,7 +62,7 @@ export const addCategory: Act = { aws(resp.state, resp.data); return; } - let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.LIST_CAT_PROD); + let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.VIEW_LIST_CAT_PROD); if (roomID == -1) { aws("error", act_error.NOT_ROOM_ADMIN); return; @@ -107,7 +107,7 @@ export const changeCategory: Act = { aws(resp.state, resp.data); return; } - let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.LIST_CAT_PROD); + let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.VIEW_LIST_CAT_PROD); if (roomID == -1) { aws("error", act_error.NOT_ROOM_ADMIN); return; @@ -140,7 +140,7 @@ export const changeCategoriesOrder: Act = { aws(resp.state, resp.data); return; } - let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.LIST_CAT_PROD); + let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.VIEW_LIST_CAT_PROD); if (roomID == -1) { aws("error", act_error.NOT_ROOM_ADMIN); return; @@ -177,7 +177,7 @@ export const deleteCategory: Act = { aws(resp.state, resp.data); return; } - let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.LIST_CAT_PROD); + let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.VIEW_LIST_CAT_PROD); if (roomID == -1) { aws("error", act_error.NOT_ROOM_ADMIN); return; @@ -262,7 +262,7 @@ export const addProduct: Act = { aws(resp.state, resp.data); return; } - let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.LIST_CAT_PROD); + let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.VIEW_LIST_CAT_PROD); if (roomID == -1) { aws("error", act_error.NOT_ROOM_ADMIN); return; @@ -318,7 +318,7 @@ export const changeProduct: Act = { aws(resp.state, resp.data); return; } - let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.LIST_CAT_PROD); + let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.VIEW_LIST_CAT_PROD); if (roomID == -1) { aws("error", act_error.NOT_ROOM_ADMIN); return; @@ -360,7 +360,7 @@ export const deleteProduct: Act = { aws(resp.state, resp.data); return; } - let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.LIST_CAT_PROD); + let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.VIEW_LIST_CAT_PROD); if (roomID == -1) { aws("error", act_error.NOT_ROOM_ADMIN); return; @@ -452,7 +452,7 @@ export const addItem: Act = { aws(resp.state, resp.data); return; } - let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.ADD_ARTICLES); + let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.ADD_ITEM); if (roomID == -1) { aws("error", act_error.NOT_ROOM_ADMIN); return; @@ -509,7 +509,7 @@ export const changeItem: Act = { aws(resp.state, resp.data); return; } - let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.ADD_ARTICLES); + let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.ADD_ITEM); if (roomID == -1) { aws("error", act_error.NOT_ROOM_ADMIN); return; @@ -583,7 +583,7 @@ export const deleteItem: Act = { aws(resp.state, resp.data); return; } - let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.REMOVE_ARTICLES); + let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.REMOVE_ITEM); if (roomID == -1) { aws("error", act_error.NOT_ROOM_ADMIN); return; @@ -612,7 +612,7 @@ export const deleteItemByState: Act = { aws(resp.state, resp.data); return; } - let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.REMOVE_ARTICLES); + let roomID = await client.isRoomAdmin(data.room, ROOM_RIGHTS.REMOVE_ITEM); if (roomID == -1) { aws("error", act_error.NOT_ROOM_ADMIN); return; diff --git a/src/server/permissions.ts b/src/server/permissions.ts index a06d768..5ab85c3 100644 --- a/src/server/permissions.ts +++ b/src/server/permissions.ts @@ -16,9 +16,9 @@ export const PERMISSIONS = { }; export const ROOM_RIGHTS = { //when changing, look in main (db defaults) - ADD_ARTICLES: 0b0000001, //change or add articles - REMOVE_ARTICLES: 0b0000010, - LIST_CAT_PROD: 0b0000100, //edit room intern listGroups and listItems + ADD_ITEM: 0b0000001, //change or add articles + REMOVE_ITEM: 0b0000010, + VIEW_LIST_CAT_PROD: 0b0000100, //edit room intern listGroups and listItems CHANGE_META: 0b0001000, OTA: 0b0010000, //edit otas MANAGE_MEMBERS: 0b0100000,