Remove the Remove System Permissions (#17401)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Hossein
2021-04-19 12:44:14 -04:00
коммит произвёл GitHub
родитель d2ed053b6b
Коммит 93c8c6e9d8

Просмотреть файл

@@ -570,16 +570,14 @@ func (a *App) getAddExperimentalSubsectionPermissions() (permissionsMap, error)
// Give the new subsection READ permissions to any user with READ_EXPERIMENTAL // Give the new subsection READ permissions to any user with READ_EXPERIMENTAL
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_EXPERIMENTAL.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_EXPERIMENTAL.Id),
Add: permissionsExperimentalRead, Add: permissionsExperimentalRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_EXPERIMENTAL.Id},
}) })
// Give the new subsection WRITE permissions to any user with WRITE_EXPERIMENTAL // Give the new subsection WRITE permissions to any user with WRITE_EXPERIMENTAL
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_EXPERIMENTAL.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_EXPERIMENTAL.Id),
Add: permissionsExperimentalWrite, Add: permissionsExperimentalWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_EXPERIMENTAL.Id},
}) })
// Give the ancillary permissions MANAGE_JOBS and PURGE_BLEVE_INDEXES to anyone with WRITE_EXPERIMENTAL_BLEVE // Give the ancillary permissions MANAGE_JOBS and PURGE_BLEVE_INDEXES to anyone with WRITE_EXPERIMENTAL_BLEVE
@@ -599,16 +597,14 @@ func (a *App) getAddIntegrationsSubsectionPermissions() (permissionsMap, error)
// Give the new subsection READ permissions to any user with READ_INTEGRATIONS // Give the new subsection READ permissions to any user with READ_INTEGRATIONS
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_INTEGRATIONS.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_INTEGRATIONS.Id),
Add: permissionsIntegrationsRead, Add: permissionsIntegrationsRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_INTEGRATIONS.Id},
}) })
// Give the new subsection WRITE permissions to any user with WRITE_EXPERIMENTAL // Give the new subsection WRITE permissions to any user with WRITE_EXPERIMENTAL
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_INTEGRATIONS.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_INTEGRATIONS.Id),
Add: permissionsIntegrationsWrite, Add: permissionsIntegrationsWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_INTEGRATIONS.Id},
}) })
return transformations, nil return transformations, nil
@@ -622,16 +618,14 @@ func (a *App) getAddSiteSubsectionPermissions() (permissionsMap, error) {
// Give the new subsection READ permissions to any user with READ_SITE // Give the new subsection READ permissions to any user with READ_SITE
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_SITE.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_SITE.Id),
Add: permissionsSiteRead, Add: permissionsSiteRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_SITE.Id},
}) })
// Give the new subsection WRITE permissions to any user with WRITE_SITE // Give the new subsection WRITE permissions to any user with WRITE_SITE
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_SITE.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_SITE.Id),
Add: permissionsSiteWrite, Add: permissionsSiteWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_SITE.Id},
}) })
// Give the ancillary permissions EDIT_BRAND to anyone with WRITE_SITE_CUSTOMIZATION // Give the ancillary permissions EDIT_BRAND to anyone with WRITE_SITE_CUSTOMIZATION
@@ -651,16 +645,14 @@ func (a *App) getAddComplianceSubsectionPermissions() (permissionsMap, error) {
// Give the new subsection READ permissions to any user with READ_COMPLIANCE // Give the new subsection READ permissions to any user with READ_COMPLIANCE
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_COMPLIANCE.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_COMPLIANCE.Id),
Add: permissionsComplianceRead, Add: permissionsComplianceRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_COMPLIANCE.Id},
}) })
// Give the new subsection WRITE permissions to any user with WRITE_COMPLIANCE // Give the new subsection WRITE permissions to any user with WRITE_COMPLIANCE
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_COMPLIANCE.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_COMPLIANCE.Id),
Add: permissionsComplianceWrite, Add: permissionsComplianceWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_COMPLIANCE.Id},
}) })
// Ancilary permissions // Ancilary permissions
@@ -728,16 +720,14 @@ func (a *App) getAddEnvironmentSubsectionPermissions() (permissionsMap, error) {
// Give the new subsection READ permissions to any user with READ_ENVIRONMENT // Give the new subsection READ permissions to any user with READ_ENVIRONMENT
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_ENVIRONMENT.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_ENVIRONMENT.Id),
Add: permissionsEnvironmentRead, Add: permissionsEnvironmentRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_ENVIRONMENT.Id},
}) })
// Give the new subsection WRITE permissions to any user with WRITE_ENVIRONMENT // Give the new subsection WRITE permissions to any user with WRITE_ENVIRONMENT
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_ENVIRONMENT.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_ENVIRONMENT.Id),
Add: permissionsEnvironmentWrite, Add: permissionsEnvironmentWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_ENVIRONMENT.Id},
}) })
// Give these ancillary permissions to anyone with READ_ENVIRONMENT_ELASTICSEARCH // Give these ancillary permissions to anyone with READ_ENVIRONMENT_ELASTICSEARCH
@@ -792,15 +782,13 @@ func (a *App) getAddAboutSubsectionPermissions() (permissionsMap, error) {
permissionsAboutWrite := []string{model.PERMISSION_SYSCONSOLE_WRITE_ABOUT_EDITION_AND_LICENSE.Id} permissionsAboutWrite := []string{model.PERMISSION_SYSCONSOLE_WRITE_ABOUT_EDITION_AND_LICENSE.Id}
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_ABOUT.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_ABOUT.Id),
Add: permissionsAboutRead, Add: permissionsAboutRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_ABOUT.Id},
}) })
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_ABOUT.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_ABOUT.Id),
Add: permissionsAboutWrite, Add: permissionsAboutWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_ABOUT.Id},
}) })
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
@@ -832,16 +820,14 @@ func (a *App) getAddReportingSubsectionPermissions() (permissionsMap, error) {
// Give the new subsection READ permissions to any user with READ_REPORTING // Give the new subsection READ permissions to any user with READ_REPORTING
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_REPORTING.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_REPORTING.Id),
Add: permissionsReportingRead, Add: permissionsReportingRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_REPORTING.Id},
}) })
// Give the new subsection WRITE permissions to any user with WRITE_REPORTING // Give the new subsection WRITE permissions to any user with WRITE_REPORTING
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_REPORTING.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_REPORTING.Id),
Add: permissionsReportingWrite, Add: permissionsReportingWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_REPORTING.Id},
}) })
// Give the ancillary permissions PERMISSION_GET_ANALYTICS to anyone with PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_USERS or PERMISSION_SYSCONSOLE_READ_REPORTING_SITE_STATISTICS // Give the ancillary permissions PERMISSION_GET_ANALYTICS to anyone with PERMISSION_SYSCONSOLE_READ_USERMANAGEMENT_USERS or PERMISSION_SYSCONSOLE_READ_REPORTING_SITE_STATISTICS
@@ -867,16 +853,14 @@ func (a *App) getAddAuthenticationSubsectionPermissions() (permissionsMap, error
// Give the new subsection READ permissions to any user with READ_AUTHENTICATION // Give the new subsection READ permissions to any user with READ_AUTHENTICATION
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_AUTHENTICATION.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_AUTHENTICATION.Id),
Add: permissionsAuthenticationRead, Add: permissionsAuthenticationRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_AUTHENTICATION.Id},
}) })
// Give the new subsection WRITE permissions to any user with WRITE_AUTHENTICATION // Give the new subsection WRITE permissions to any user with WRITE_AUTHENTICATION
transformations = append(transformations, permissionTransformation{ transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_AUTHENTICATION.Id), On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_AUTHENTICATION.Id),
Add: permissionsAuthenticationWrite, Add: permissionsAuthenticationWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_AUTHENTICATION.Id},
}) })
// Give the ancillary permissions for LDAP to anyone with WRITE_AUTHENTICATION_LDAP // Give the ancillary permissions for LDAP to anyone with WRITE_AUTHENTICATION_LDAP