openvibers/openvibe.live Commits
Pastes on Community: Live admins and global mods act as staff (X-OV-Staff), so moderation of others' pastes keeps working
Changes
@@@ -266,6 +266,8 @@ function toCommunity(subPath) {const sid = req.user.subject_id || await pastesClient.subjectForLiveUser(req.user.id);if (!sid) return res.status(409).json({ error: 'This account is not linked to an OpenVibe account yet. Sign in again and retry.' });headers['X-OV-Subject'] = sid;++ // Live staff moderate pastes as staff (Community checks our community.paste.moderate grant).++ if (req.user.role === 'admin' || req.user.role === 'global_mod') headers['X-OV-Staff'] = '1';}if (req.ip) headers['X-Forwarded-For'] = req.ip;const opts = { method: req.method, headers, redirect: 'manual', signal: AbortSignal.timeout(req.method === 'GET' ? 20000 : 120000) };
@@ -266,6 +266,8 @@ function toCommunity(subPath) {
@@ -266,6 +266,8 @@ function toCommunity(subPath) {
const sid = req.user.subject_id || await pastesClient.subjectForLiveUser(req.user.id);
const sid = req.user.subject_id || await pastesClient.subjectForLiveUser(req.user.id);
if (!sid) return res.status(409).json({ error: 'This account is not linked to an OpenVibe account yet. Sign in again and retry.' });
if (!sid) return res.status(409).json({ error: 'This account is not linked to an OpenVibe account yet. Sign in again and retry.' });
headers['X-OV-Subject'] = sid;
headers['X-OV-Subject'] = sid;
+ // Live staff moderate pastes as staff (Community checks our community.paste.moderate grant).
+ if (req.user.role === 'admin' || req.user.role === 'global_mod') headers['X-OV-Staff'] = '1';
}
}
if (req.ip) headers['X-Forwarded-For'] = req.ip;
if (req.ip) headers['X-Forwarded-For'] = req.ip;
const opts = { method: req.method, headers, redirect: 'manual', signal: AbortSignal.timeout(req.method === 'GET' ? 20000 : 120000) };
const opts = { method: req.method, headers, redirect: 'manual', signal: AbortSignal.timeout(req.method === 'GET' ? 20000 : 120000) };