Skip to content

Commit

Permalink
ENG-10094: Deprecate 'View Sidecars and Repositories' (#315)
Browse files Browse the repository at this point in the history
* deprecate view sidecars and repos

* edit deprecation message

* edit deprecation message

* update docs

* undo modification of resource
  • Loading branch information
hbaackmann authored Nov 11, 2022
1 parent ef10988 commit a93599b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 7 additions & 0 deletions cyral/resource_cyral_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

const (
permissionIsDeprecatedMessage = "Setting this permission is " +
"deprecated. It will be automatically granted to all Cyral " +
"Roles for Control Planes `v3.x` and later."
)

// Roles correspond to Groups in API.
type RoleDataRequest struct {
Name string `json:"name,omitempty"`
Expand Down Expand Up @@ -82,6 +88,7 @@ func resourceRole() *schema.Resource {
Description: "Allows viewing sidecars and repositories for this role. Defaults to `false`.",
Type: schema.TypeBool,
Optional: true,
Deprecated: permissionIsDeprecatedMessage,
Default: false,
},
"view_audit_logs": {
Expand Down
6 changes: 0 additions & 6 deletions cyral/resource_cyral_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ var onlyFalsePermissions = map[string]string{
"modify_sidecars_and_repositories": "false",
"modify_users": "false",
"modify_policies": "false",
"view_sidecars_and_repositories": "false",
"view_audit_logs": "false",
"modify_integrations": "false",
"modify_roles": "false",
Expand All @@ -35,7 +34,6 @@ var trueAndFalsePermissions = map[string]string{
"modify_sidecars_and_repositories": "true",
"modify_users": "true",
"modify_policies": "true",
"view_sidecars_and_repositories": "true",
"view_audit_logs": "false",
"modify_integrations": "false",
"modify_roles": "false",
Expand All @@ -46,7 +44,6 @@ var onlyTruePermissions = map[string]string{
"modify_sidecars_and_repositories": "true",
"modify_users": "true",
"modify_policies": "true",
"view_sidecars_and_repositories": "true",
"view_audit_logs": "true",
"modify_integrations": "true",
"modify_roles": "true",
Expand Down Expand Up @@ -155,7 +152,6 @@ func testAccRoleConfig_OnlyFalsePermissions() string {
modify_sidecars_and_repositories = false
modify_users = false
modify_policies = false
view_sidecars_and_repositories = false
view_audit_logs = false
modify_integrations = false
modify_roles = false
Expand All @@ -182,7 +178,6 @@ func testAccRoleConfig_TrueAndFalsePermissions() string {
modify_sidecars_and_repositories = true
modify_users = true
modify_policies = true
view_sidecars_and_repositories = true
view_audit_logs = false
modify_integrations = false
modify_roles = false
Expand All @@ -209,7 +204,6 @@ func testAccRoleConfig_OnlyTruePermissions() string {
modify_sidecars_and_repositories = true
modify_users = true
modify_policies = true
view_sidecars_and_repositories = true
view_audit_logs = true
modify_integrations = true
modify_roles = true
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/role.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ Optional:
- `modify_users` (Boolean) Allows modifying users for this role. Defaults to `false`.
- `view_audit_logs` (Boolean) Allows viewing audit logs for this role. Defaults to `false`.
- `view_datamaps` (Boolean) Allows viewing datamaps for this role. Defaults to `false`.
- `view_sidecars_and_repositories` (Boolean) Allows viewing sidecars and repositories for this role. Defaults to `false`.
- `view_sidecars_and_repositories` (Boolean, Deprecated) Allows viewing sidecars and repositories for this role. Defaults to `false`.

0 comments on commit a93599b

Please sign in to comment.