MM-15021: Adding new builtin system schema for Guests (#10601)
* MM-15021: Adding new builtin system schema for Guests * Fixing tests * Setting properly the permissions * Adding guests to sampledata * Restrict more roles updates in the app layer for guests * Adding comment to explain that permissions migration must go at the end * Setting the default guest role for custom scheme during migration * Fixing import and export * Creating scheme guest roles on migration * Fixing tests * Fixing tests * Fixing tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
987360f325
Коммит
584ec68755
@@ -154,6 +154,7 @@ func UpgradeDatabase(sqlStore SqlStore, currentModelVersionString string) error
|
||||
UpgradeDatabaseToVersion59(sqlStore)
|
||||
UpgradeDatabaseToVersion510(sqlStore)
|
||||
UpgradeDatabaseToVersion511(sqlStore)
|
||||
UpgradeDatabaseToVersion512(sqlStore)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -677,3 +678,16 @@ func UpgradeDatabaseToVersion511(sqlStore SqlStore) {
|
||||
// saveSchemaVersion(sqlStore, VERSION_5_11_0)
|
||||
// }
|
||||
}
|
||||
|
||||
func UpgradeDatabaseToVersion512(sqlStore SqlStore) {
|
||||
// TODO: Uncomment following condition when version 5.12.0 is released
|
||||
// if shouldPerformUpgrade(sqlStore, VERSION_5_11_0, VERSION_5_12_0) {
|
||||
sqlStore.CreateColumnIfNotExistsNoDefault("TeamMembers", "SchemeGuest", "boolean", "boolean")
|
||||
sqlStore.CreateColumnIfNotExistsNoDefault("ChannelMembers", "SchemeGuest", "boolean", "boolean")
|
||||
sqlStore.CreateColumnIfNotExistsNoDefault("Schemes", "DefaultTeamGuestRole", "text", "VARCHAR(64)")
|
||||
sqlStore.CreateColumnIfNotExistsNoDefault("Schemes", "DefaultChannelGuestRole", "text", "VARCHAR(64)")
|
||||
sqlStore.GetMaster().Exec("UPDATE Schemes SET DefaultTeamGuestRole = '', DefaultChannelGuestRole = ''")
|
||||
|
||||
// saveSchemaVersion(sqlStore, VERSION_5_12_0)
|
||||
// }
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user