don't apply rollback limits to admins
This commit is contained in:
parent
e2dd53add6
commit
1b3a54224f
|
@ -292,6 +292,7 @@ export async function executeRollback(
|
||||||
brcoor,
|
brcoor,
|
||||||
canvasid,
|
canvasid,
|
||||||
logger = null,
|
logger = null,
|
||||||
|
isAdmin = false,
|
||||||
) {
|
) {
|
||||||
if (!canvasid) {
|
if (!canvasid) {
|
||||||
return [403, 'canvasid not defined'];
|
return [403, 'canvasid not defined'];
|
||||||
|
@ -320,8 +321,8 @@ export async function executeRollback(
|
||||||
|
|
||||||
const width = u - x + 1;
|
const width = u - x + 1;
|
||||||
const height = v - y + 1;
|
const height = v - y + 1;
|
||||||
if (width * height > 1000000) {
|
if (!isAdmin && width * height > 1000000) {
|
||||||
return [403, 'Can not rollback more than 1m pixels at onec'];
|
return [403, 'Can not rollback more than 1m pixels at once'];
|
||||||
}
|
}
|
||||||
|
|
||||||
const pxlCount = await rollbackCanvasArea(
|
const pxlCount = await rollbackCanvasArea(
|
||||||
|
|
|
@ -144,6 +144,7 @@ router.post('/', upload.single('image'), async (req, res, next) => {
|
||||||
brcoor,
|
brcoor,
|
||||||
canvasid,
|
canvasid,
|
||||||
aLogger,
|
aLogger,
|
||||||
|
(req.user.userlvl === 1),
|
||||||
);
|
);
|
||||||
res.status(ret).send(msg);
|
res.status(ret).send(msg);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user