mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-05 15:19:02 +02:00
bc3d6c3636
fix for block affiliations for managed users GitOrigin-RevId: cac54288592323ea3f1cd7655d4e2b89ee301002
30 lines
1.0 KiB
JavaScript
30 lines
1.0 KiB
JavaScript
const mongoose = require('../infrastructure/Mongoose')
|
|
|
|
const { Schema } = mongoose
|
|
|
|
const GroupPolicySchema = new Schema(
|
|
{
|
|
// User can't delete their own account
|
|
userCannotDeleteOwnAccount: Boolean,
|
|
|
|
// User can't add a secondary email address, or affiliation
|
|
userCannotHaveSecondaryEmail: Boolean,
|
|
|
|
// User can't have an active (currently auto-renewing) personal subscription, nor can they start one
|
|
userCannotHaveSubscription: Boolean,
|
|
|
|
// User can't choose to leave the group subscription they are managed by
|
|
userCannotLeaveManagingGroupSubscription: Boolean,
|
|
|
|
// User can't have a Google SSO account, nor can they link it to their account
|
|
userCannotHaveGoogleSSO: Boolean,
|
|
|
|
// User can't have other third-party SSO (e.g. Twitter/ORCID/IEEE) active on their account, nor can they link it to their account
|
|
userCannotHaveOtherThirdPartySSO: Boolean,
|
|
},
|
|
{ minimize: false }
|
|
)
|
|
|
|
exports.GroupPolicy = mongoose.model('GroupPolicy', GroupPolicySchema)
|
|
exports.GroupPolicySchema = GroupPolicySchema
|