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{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_EXPERIMENTAL.Id),
Add: permissionsExperimentalRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_EXPERIMENTAL.Id},
})
// Give the new subsection WRITE permissions to any user with WRITE_EXPERIMENTAL
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_EXPERIMENTAL.Id),
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
@@ -601,14 +599,12 @@ func (a *App) getAddIntegrationsSubsectionPermissions() (permissionsMap, error)
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_INTEGRATIONS.Id),
Add: permissionsIntegrationsRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_INTEGRATIONS.Id},
})
// Give the new subsection WRITE permissions to any user with WRITE_EXPERIMENTAL
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_INTEGRATIONS.Id),
Add: permissionsIntegrationsWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_INTEGRATIONS.Id},
})
return transformations, nil
@@ -624,14 +620,12 @@ func (a *App) getAddSiteSubsectionPermissions() (permissionsMap, error) {
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_SITE.Id),
Add: permissionsSiteRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_SITE.Id},
})
// Give the new subsection WRITE permissions to any user with WRITE_SITE
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_SITE.Id),
Add: permissionsSiteWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_SITE.Id},
})
// 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{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_COMPLIANCE.Id),
Add: permissionsComplianceRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_COMPLIANCE.Id},
})
// Give the new subsection WRITE permissions to any user with WRITE_COMPLIANCE
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_COMPLIANCE.Id),
Add: permissionsComplianceWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_COMPLIANCE.Id},
})
// Ancilary permissions
@@ -730,14 +722,12 @@ func (a *App) getAddEnvironmentSubsectionPermissions() (permissionsMap, error) {
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_ENVIRONMENT.Id),
Add: permissionsEnvironmentRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_ENVIRONMENT.Id},
})
// Give the new subsection WRITE permissions to any user with WRITE_ENVIRONMENT
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_ENVIRONMENT.Id),
Add: permissionsEnvironmentWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_ENVIRONMENT.Id},
})
// Give these ancillary permissions to anyone with READ_ENVIRONMENT_ELASTICSEARCH
@@ -794,13 +784,11 @@ func (a *App) getAddAboutSubsectionPermissions() (permissionsMap, error) {
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_ABOUT.Id),
Add: permissionsAboutRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_ABOUT.Id},
})
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_ABOUT.Id),
Add: permissionsAboutWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_ABOUT.Id},
})
transformations = append(transformations, permissionTransformation{
@@ -834,14 +822,12 @@ func (a *App) getAddReportingSubsectionPermissions() (permissionsMap, error) {
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_REPORTING.Id),
Add: permissionsReportingRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_REPORTING.Id},
})
// Give the new subsection WRITE permissions to any user with WRITE_REPORTING
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_REPORTING.Id),
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
@@ -869,14 +855,12 @@ func (a *App) getAddAuthenticationSubsectionPermissions() (permissionsMap, error
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_READ_AUTHENTICATION.Id),
Add: permissionsAuthenticationRead,
Remove: []string{model.PERMISSION_SYSCONSOLE_READ_AUTHENTICATION.Id},
})
// Give the new subsection WRITE permissions to any user with WRITE_AUTHENTICATION
transformations = append(transformations, permissionTransformation{
On: permissionExists(model.PERMISSION_SYSCONSOLE_WRITE_AUTHENTICATION.Id),
Add: permissionsAuthenticationWrite,
Remove: []string{model.PERMISSION_SYSCONSOLE_WRITE_AUTHENTICATION.Id},
})
// Give the ancillary permissions for LDAP to anyone with WRITE_AUTHENTICATION_LDAP