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