Marketing Hub: RBAC, i18n (AR/EN), tasks overhaul, team/user merge, tutorial
Features: - Full RBAC with 3 roles (superadmin/manager/contributor) - Ownership tracking on posts, tasks, campaigns, projects - Task system: assign to anyone, filter combobox, visibility scoping - Team members merged into users table (single source of truth) - Post thumbnails on kanban cards from attachments - Publication link validation before publishing - Interactive onboarding tutorial with Settings restart - Full Arabic/English i18n with RTL layout support - Language toggle in sidebar, IBM Plex Sans Arabic font - Brand-based visibility filtering for non-superadmins - Manager can only create contributors - Profile completion flow for new users - Cookie-based sessions (express-session + SQLite)
This commit is contained in:
30
server/node_modules/cacache/lib/util/disposer.js
generated
vendored
Normal file
30
server/node_modules/cacache/lib/util/disposer.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict'
|
||||
|
||||
module.exports.disposer = disposer
|
||||
|
||||
function disposer (creatorFn, disposerFn, fn) {
|
||||
const runDisposer = (resource, result, shouldThrow = false) => {
|
||||
return disposerFn(resource)
|
||||
.then(
|
||||
// disposer resolved, do something with original fn's promise
|
||||
() => {
|
||||
if (shouldThrow)
|
||||
throw result
|
||||
|
||||
return result
|
||||
},
|
||||
// Disposer fn failed, crash process
|
||||
(err) => {
|
||||
throw err
|
||||
// Or process.exit?
|
||||
})
|
||||
}
|
||||
|
||||
return creatorFn
|
||||
.then((resource) => {
|
||||
// fn(resource) can throw, so wrap in a promise here
|
||||
return Promise.resolve().then(() => fn(resource))
|
||||
.then((result) => runDisposer(resource, result))
|
||||
.catch((err) => runDisposer(resource, err, true))
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user