fix: Some todos

pull/7619/head
Ruslan Semak 8 months ago
parent 48412d8330
commit e4dd467d91

@ -19,10 +19,12 @@ router.post('/u', (req, res, next) => {
} }
}).array('mediaUpload')(req, res, next) }).array('mediaUpload')(req, res, next)
}, async (req, res, next) => { }, async (req, res, next) => {
const disableFlag = true
/** /**
* Ruslan: Disable this check for bulk uploading * Ruslan: Disable this check for bulk uploading
*/ */
if (!_.some(req.user.permissions, pm => _.includes(['write:assets', 'manage:system'], pm))) { if (disableFlag && !_.some(req.user.permissions, pm => _.includes(['write:assets', 'manage:system'], pm))) {
return res.status(403).json({ return res.status(403).json({
succeeded: false, succeeded: false,
message: 'You are not authorized to upload files.' message: 'You are not authorized to upload files.'
@ -86,7 +88,7 @@ router.post('/u', (req, res, next) => {
/** /**
* Ruslan: Disable this check for bulk uploading * Ruslan: Disable this check for bulk uploading
*/ */
if (!WIKI.auth.checkAccess(req.user, ['write:assets'], { path: assetPath })) { if (disableFlag && !WIKI.auth.checkAccess(req.user, ['write:assets'], { path: assetPath })) {
return res.status(403).json({ return res.status(403).json({
succeeded: false, succeeded: false,
message: 'You are not authorized to upload files to this folder.' message: 'You are not authorized to upload files to this folder.'

@ -724,6 +724,10 @@ module.exports = class Page extends Model {
const destinationHash = pageHelper.generateHash({ path: opts.destinationPath, locale: opts.destinationLocale, privateNS: opts.isPrivate ? 'TODO' : '' }) const destinationHash = pageHelper.generateHash({ path: opts.destinationPath, locale: opts.destinationLocale, privateNS: opts.isPrivate ? 'TODO' : '' })
/**
* RUSLAN: Here should be checking all exists pages for links for moving page.
*/
// -> Move page // -> Move page
const destinationTitle = (page.title === _.last(page.path.split('/')) ? _.last(opts.destinationPath.split('/')) : page.title) const destinationTitle = (page.title === _.last(page.path.split('/')) ? _.last(opts.destinationPath.split('/')) : page.title)
await WIKI.models.pages.query().patch({ await WIKI.models.pages.query().patch({

Loading…
Cancel
Save