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

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

@@ -572,14 +572,12 @@ func (a *App) getAddExperimentalSubsectionPermissions() (permissionsMap, error)
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
@@ -601,14 +599,12 @@ func (a *App) getAddIntegrationsSubsectionPermissions() (permissionsMap, error)
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
@@ -624,14 +620,12 @@ func (a *App) getAddSiteSubsectionPermissions() (permissionsMap, error) {
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
@@ -653,14 +647,12 @@ func (a *App) getAddComplianceSubsectionPermissions() (permissionsMap, error) {
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
@@ -730,14 +722,12 @@ func (a *App) getAddEnvironmentSubsectionPermissions() (permissionsMap, error) {
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
@@ -794,13 +784,11 @@ func (a *App) getAddAboutSubsectionPermissions() (permissionsMap, error) {
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{
@@ -834,14 +822,12 @@ func (a *App) getAddReportingSubsectionPermissions() (permissionsMap, error) {
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
@@ -869,14 +855,12 @@ func (a *App) getAddAuthenticationSubsectionPermissions() (permissionsMap, error
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