mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-04-07 14:04:35 +08:00
[feature] Add tenant statistics; Fix bug 76520
This commit is contained in:
@ -91,6 +91,21 @@ async function licenseInfo(req, res, getConnections = null) {
|
||||
const ctx = new operationContext.Context();
|
||||
try {
|
||||
ctx.initFromRequest(req);
|
||||
|
||||
const requestedTenant = req.query && req.query.tenant;
|
||||
if (requestedTenant) {
|
||||
const userTenant = req.user && req.user.tenant;
|
||||
if (userTenant && requestedTenant !== userTenant) {
|
||||
const defaultTenant = tenantManager.getDefautTenant();
|
||||
if (userTenant !== defaultTenant) {
|
||||
if (!res.headersSent) {
|
||||
res.status(403).json({error: 'Forbidden'});
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
ctx.setTenant(requestedTenant);
|
||||
}
|
||||
await ctx.initTenantCache();
|
||||
ctx.logger.debug('licenseInfo start');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user