import Planka upstream

This commit is contained in:
xiaojibeier
2026-07-18 11:48:22 +08:00
commit c26fd3b190
1564 changed files with 214813 additions and 0 deletions
View File
+12
View File
@@ -0,0 +1,12 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
module.exports = async function isAuthenticated(req, res, proceed) {
if (!sails.helpers.users.isAdminOrProjectOwner(req.currentUser)) {
return res.notFound(); // Forbidden
}
return proceed();
};
+12
View File
@@ -0,0 +1,12 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
module.exports = async function isAuthenticated(req, res, proceed) {
if (req.currentUser.role !== User.Roles.ADMIN) {
return res.notFound(); // Forbidden
}
return proceed();
};
+13
View File
@@ -0,0 +1,13 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
module.exports = async function isAuthenticated(req, res, proceed) {
if (!req.currentUser) {
// TODO: provide separate error for API keys?
return res.unauthorized('Access token is missing, invalid or expired');
}
return proceed();
};
+12
View File
@@ -0,0 +1,12 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
module.exports = async function isExternal(req, res, proceed) {
if (req.currentUser.id === User.INTERNAL.id) {
return res.notFound(); // Forbidden
}
return proceed();
};
+12
View File
@@ -0,0 +1,12 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
module.exports = async function isInternal(req, res, proceed) {
if (req.currentUser.id !== User.INTERNAL.id) {
return res.notFound(); // Forbidden
}
return proceed();
};
+12
View File
@@ -0,0 +1,12 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
module.exports = async function isSession(req, res, proceed) {
if (!req.currentSession) {
return res.notFound(); // Forbidden
}
return proceed();
};