This commit is contained in:
jusax23 2023-04-01 09:55:46 +02:00
parent 5b37f3eafb
commit acb6fe2c4b
Signed by: jusax23
GPG key ID: 499E2AA870C1CD41
2 changed files with 14 additions and 14 deletions

View file

@ -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;

View file

@ -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,