page_permissions

package
v2.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PagePermissionsResourceMarkdownDescription = `

# Page Permissions resource

Docs about page permissions can be found [here](https://docs.getport.io/customize-pages-dashboards-and-plugins/page/page-permissions?view-permissions=api).

## Example Usage

### Allow read access to all members:

` + "```hcl" + `
resource "port_page_permissions" "microservices_permissions" {
  page_identifier = "microservices"
  read = {
    "roles": ["Member"],
    "users": [],
    "teams": [],
  }
}` + "\n```" + `

### Allow read access to all admins and a specific user and team:

` + "```hcl" + `
resource "port_page_permissions" "microservices_permissions" {
  page_identifier = "microservices"
  read = {
    "roles": [
      "Admin",
    ],
    "users": ["test-admin-user@test.com"],
    "teams": ["Team Spiderman"],
  }
}` + "\n```" + `

### Allow read access to specific users and teams:

` + "```hcl" + `
resource "port_page_permissions" "microservices_permissions" {
  page_identifier = "microservices"
  read = {
    "roles": [],
    "users": ["test-admin-user@test.com"],
    "teams": ["Team Spiderman"],
  }
}` + "\n```" + `

## Disclaimer 

- Page permissions are created by default when page is first created, this means that you should use this resource when you want to change the default permissions of a page.
- When deleting a page permissions resource using terraform, the page permissions will not be deleted from Port, as they are required for the action to work, instead, the page permissions will be removed from the terraform state.
`

Functions

func NewPagePermissionsResource

func NewPagePermissionsResource() resource.Resource

func PagePermissionsSchema

func PagePermissionsSchema() map[string]schema.Attribute

Types

type PagePermissionsModel

type PagePermissionsModel struct {
	ID             types.String             `tfsdk:"id"`
	PageIdentifier types.String             `tfsdk:"page_identifier"`
	Read           ReadPagePermissionsModel `tfsdk:"read"`
}

type PagePermissionsResource

type PagePermissionsResource struct {
	// contains filtered or unexported fields
}

func (*PagePermissionsResource) Configure

func (*PagePermissionsResource) Create

func (*PagePermissionsResource) Delete

func (*PagePermissionsResource) ImportState

func (*PagePermissionsResource) Metadata

func (*PagePermissionsResource) Read

func (*PagePermissionsResource) Schema

func (*PagePermissionsResource) Update

type ReadPagePermissionsModel

type ReadPagePermissionsModel struct {
	Users []types.String `tfsdk:"users"`
	Roles []types.String `tfsdk:"roles"`
	Teams []types.String `tfsdk:"teams"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL