Files
wekan/models/team.js
T
Lauri OjansivuandClaude Opus 4.8 ce09a25601 Make the per-org/team membership-sync setting auth-agnostic (#4737, #5850).
Renames the "Sync Members From LDAP" column to "Sync Members From Auth Provider"
so the setting and feature apply to any authentication provider (LDAP,
OAuth2/OIDC, SAML, etc.), not just LDAP. Renames the field/method/i18n key from
*SyncMembersFromLdap / sync-members-from-ldap to *SyncMembersFromAuth /
sync-members-from-auth across schema, publications, admin methods and the admin
UI, and generalizes the translation string and code comments. The other two
columns (Shared Templates, Propagate Members To Boards) were already
auth-agnostic. Thanks to xet7.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 11:35:28 +03:00

104 lines
2.3 KiB
JavaScript

import { Mongo } from 'meteor/mongo';
import { ReactiveCache } from '/imports/reactiveCache';
const { SimpleSchema } = require('/imports/simpleSchema');
const Team = new Mongo.Collection('team');
/**
* A Team in Wekan. Organization in Trello.
*/
Team.attachSchema(
new SimpleSchema({
teamDisplayName: {
/**
* the name to display for the team
*/
type: String,
optional: true,
},
teamDesc: {
/**
* the description the team
*/
type: String,
optional: true,
max: 190,
},
teamShortName: {
/**
* short name of the team
*/
type: String,
optional: true,
max: 255,
},
teamWebsite: {
/**
* website of the team
*/
type: String,
optional: true,
max: 255,
},
teamIsActive: {
/**
* status of the team
*/
type: Boolean,
optional: true,
},
teamSharedTemplates: {
/**
* #5850: members may drag personal Template Boards onto this team to share
* (per-team form of "Shared Templates for Teams"). Off by default.
*/
type: Boolean,
optional: true,
},
teamPropagateMembersToBoards: {
/**
* #4737: add this team's members to the boards that list this team. Off by default.
*/
type: Boolean,
optional: true,
},
teamSyncMembersFromAuth: {
/**
* #4737: this team's membership is maintained by the authentication
* provider's group/membership sync (LDAP, OAuth2/OIDC, SAML, etc.). Off by default.
*/
type: Boolean,
optional: true,
},
createdAt: {
/**
* creation date of the team
*/
type: Date,
// eslint-disable-next-line consistent-return
autoValue() {
if (this.isInsert) {
return new Date();
} else if (this.isUpsert) {
return { $setOnInsert: new Date() };
} else {
this.unset();
}
},
},
modifiedAt: {
type: Date,
// eslint-disable-next-line consistent-return
autoValue() {
if (this.isInsert || this.isUpsert || this.isUpdate) {
return new Date();
} else {
this.unset();
}
},
},
}),
);
export default Team;