mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Adjust addCategoryApps for device specific assignments
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2020 Jonas Lochmann
|
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -80,6 +80,16 @@ export async function dispatchAddCategoryApps ({ action, cache, fromChildSelfLim
|
|||||||
})).map((item) => item.categoryId)
|
})).map((item) => item.categoryId)
|
||||||
|
|
||||||
if (fromChildSelfLimitAddChildUserId !== null) {
|
if (fromChildSelfLimitAddChildUserId !== null) {
|
||||||
|
for (let i = 0; i < action.packageNames.length; i++) {
|
||||||
|
const packageName = action.packageNames[i]
|
||||||
|
|
||||||
|
if (packageName.indexOf('@') !== -1) {
|
||||||
|
throw new SelfLimitationException({
|
||||||
|
staticMessage: 'can not do device specific assignments as child'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const parentCategoriesOfTargetCategory = getCategoryWithParentCategories(categoriesOfSameChild, action.categoryId)
|
const parentCategoriesOfTargetCategory = getCategoryWithParentCategories(categoriesOfSameChild, action.categoryId)
|
||||||
const userEntryUnsafe = await cache.database.user.findOne({
|
const userEntryUnsafe = await cache.database.user.findOne({
|
||||||
|
|||||||
Reference in New Issue
Block a user