Fix streaming of disabled timelines with special permissions (#37791)
This commit is contained in:
@@ -375,6 +375,7 @@ const startServer = async () => {
|
|||||||
req.scopes = result.rows[0].scopes.split(' ');
|
req.scopes = result.rows[0].scopes.split(' ');
|
||||||
req.accountId = result.rows[0].account_id;
|
req.accountId = result.rows[0].account_id;
|
||||||
req.chosenLanguages = result.rows[0].chosen_languages;
|
req.chosenLanguages = result.rows[0].chosen_languages;
|
||||||
|
req.permissions = result.rows[0].permissions;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
accessTokenId: result.rows[0].id,
|
accessTokenId: result.rows[0].id,
|
||||||
@@ -600,13 +601,13 @@ const startServer = async () => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} kind
|
* @param {string} kind
|
||||||
* @param {ResolvedAccount} account
|
* @param {Request} req
|
||||||
* @returns {Promise.<{ localAccess: boolean, remoteAccess: boolean }>}
|
* @returns {Promise.<{ localAccess: boolean, remoteAccess: boolean }>}
|
||||||
*/
|
*/
|
||||||
const getFeedAccessSettings = async (kind, account) => {
|
const getFeedAccessSettings = async (kind, req) => {
|
||||||
const access = { localAccess: true, remoteAccess: true };
|
const access = { localAccess: true, remoteAccess: true };
|
||||||
|
|
||||||
if (account.permissions & PERMISSION_VIEW_FEEDS) {
|
if (req.permissions & PERMISSION_VIEW_FEEDS) {
|
||||||
return access;
|
return access;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user