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
@@ -69,8 +69,10 @@ func TestExportPermissions(t *testing.T) {
|
||||
scheme.Scope: func(str string) string { return row["scope"].(string) },
|
||||
scheme.DefaultTeamAdminRole: func(str string) string { return getRoleByName(str) },
|
||||
scheme.DefaultTeamUserRole: func(str string) string { return getRoleByName(str) },
|
||||
scheme.DefaultTeamGuestRole: func(str string) string { return getRoleByName(str) },
|
||||
scheme.DefaultChannelAdminRole: func(str string) string { return getRoleByName(str) },
|
||||
scheme.DefaultChannelUserRole: func(str string) string { return getRoleByName(str) },
|
||||
scheme.DefaultChannelGuestRole: func(str string) string { return getRoleByName(str) },
|
||||
}
|
||||
|
||||
for key, valF := range expectations {
|
||||
@@ -137,6 +139,11 @@ func TestImportPermissions(t *testing.T) {
|
||||
t.Error(appErr)
|
||||
}
|
||||
|
||||
channelGuestRole, appErr := th.App.GetRoleByName(newScheme.DefaultChannelGuestRole)
|
||||
if appErr != nil {
|
||||
t.Error(appErr)
|
||||
}
|
||||
|
||||
expectations := map[string]string{
|
||||
newScheme.DisplayName: displayName,
|
||||
newScheme.Name: name,
|
||||
@@ -144,8 +151,10 @@ func TestImportPermissions(t *testing.T) {
|
||||
newScheme.Scope: scope,
|
||||
newScheme.DefaultTeamAdminRole: "",
|
||||
newScheme.DefaultTeamUserRole: "",
|
||||
newScheme.DefaultTeamGuestRole: "",
|
||||
channelAdminRole.Name: newScheme.DefaultChannelAdminRole,
|
||||
channelUserRole.Name: newScheme.DefaultChannelUserRole,
|
||||
channelGuestRole.Name: newScheme.DefaultChannelGuestRole,
|
||||
}
|
||||
|
||||
for actual, expected := range expectations {
|
||||
|
||||
Ссылка в новой задаче
Block a user