GroupPolicy.mjs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import mongoose from '../infrastructure/Mongoose.mjs'
  2. const { Schema } = mongoose
  3. export const GroupPolicySchema = new Schema(
  4. {
  5. // User can't delete their own account
  6. userCannotDeleteOwnAccount: Boolean,
  7. // User can't add a secondary email address, or affiliation
  8. userCannotHaveSecondaryEmail: Boolean,
  9. // User can't have an active (currently auto-renewing) personal subscription, nor can they start one
  10. userCannotHaveSubscription: Boolean,
  11. // User can't choose to leave the group subscription they are managed by
  12. userCannotLeaveManagingGroupSubscription: Boolean,
  13. // User can't have a Google SSO account, nor can they link it to their account
  14. userCannotHaveGoogleSSO: Boolean,
  15. // User can't have other third-party SSO (e.g. ORCID/IEEE) active on their account, nor can they link it to their account
  16. userCannotHaveOtherThirdPartySSO: Boolean,
  17. // User can't use any of our AI features, such as the compile-assistant
  18. userCannotUseAIFeatures: Boolean,
  19. // User can't use the chat feature
  20. userCannotUseChat: Boolean,
  21. // User can't use the Dropbox feature
  22. userCannotUseDropbox: Boolean,
  23. },
  24. { minimize: false }
  25. )
  26. export const GroupPolicy = mongoose.model('GroupPolicy', GroupPolicySchema)