Merge pull request #14432 from overleaf/msm-repurpose-managed-users-flag

[web] Repurpose `managedUsers.enabled` flag

GitOrigin-RevId: b968048a51feba887aaed798908779612e8c8c96
This commit is contained in:
Miguel Serrano 2023-08-23 12:21:29 +02:00 committed by Copybot
parent 9727cfb6b7
commit 0bb5e27dff
2 changed files with 1 additions and 8 deletions

View file

@ -17,15 +17,9 @@ const EmailHelper = require('../Helpers/EmailHelper')
const { csvAttachment } = require('../../infrastructure/Response')
const { UserIsManagerError } = require('./UserMembershipErrors')
const CSVParser = require('json2csv').Parser
const Settings = require('@overleaf/settings')
function isManagedUsersActiveOnGroup(entity) {
return !!(Settings.managedUsers?.enabled && entity.groupPolicy)
}
async function manageGroupMembers(req, res, next) {
const { entity, entityConfig } = req
const managedUsersActive = isManagedUsersActiveOnGroup(entity)
return entity.fetchV1Data(function (error, entity) {
if (error != null) {
return next(error)
@ -48,7 +42,7 @@ async function manageGroupMembers(req, res, next) {
groupId: entityPrimaryKey,
users,
groupSize: entity.membersLimit,
managedUsersActive,
managedUsersActive: entity.groupPolicy != null,
})
}
)

View file

@ -127,7 +127,6 @@ describe('UserMembershipController', function () {
it('render group view with managed users', async function () {
this.req.entity.groupPolicy = { somePolicy: true }
this.Settings.managedUsers.enabled = true
return await this.UserMembershipController.manageGroupMembers(this.req, {
render: (viewPath, viewParams) => {
expect(viewPath).to.equal('user_membership/group-members-react')