|
@@ -20,12 +20,14 @@ class AccessControl {
|
|
return groups;
|
|
return groups;
|
|
}
|
|
}
|
|
|
|
|
|
- async checkUser(maintainers) {
|
|
|
|
|
|
+ async checkUser(maintainers, isAdmin = false) {
|
|
if (Array.isArray(maintainers) && maintainers.length > 0) {
|
|
if (Array.isArray(maintainers) && maintainers.length > 0) {
|
|
let uuids = [];
|
|
let uuids = [];
|
|
|
|
|
|
let queries = maintainers.map(async (maintainer) => {
|
|
let queries = maintainers.map(async (maintainer) => {
|
|
- const sql = 'SELECT uuid FROM `users` WHERE username = ?';
|
|
|
|
|
|
+ let sql = 'SELECT uuid FROM `users` WHERE username = ?';
|
|
|
|
+ if(isAdmin)
|
|
|
|
+ sql = 'SELECT uuid FROM `users` WHERE username = ? AND manage = 1';
|
|
const rows = await db.query(sql, [maintainer]);
|
|
const rows = await db.query(sql, [maintainer]);
|
|
|
|
|
|
if (!rows || rows.length === 0) {
|
|
if (!rows || rows.length === 0) {
|