Skip to content

feat: add permission resource, data source, and organization role permission resource#9

Closed
danielloader wants to merge 1 commit into
osodevops:mainfrom
danielloader:feat/organization-role-permission
Closed

feat: add permission resource, data source, and organization role permission resource#9
danielloader wants to merge 1 commit into
osodevops:mainfrom
danielloader:feat/organization-role-permission

Conversation

@danielloader

@danielloader danielloader commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds workos_permission resource for CRUD management of environment-level permissions
  • Adds workos_permission data source for looking up existing permissions by slug
  • Adds workos_organization_role_permission resource for assigning permissions to organization roles
  • Adds client methods for permission CRUD and role permission assignment/removal endpoints
  • Updates README, examples, and generated docs

Test plan

  • go build ./... passes
  • go generate ./... produces clean docs
  • TF_ACC=1 go test ./internal/provider/ -run TestAccPermission -v
  • TF_ACC=1 go test ./internal/provider/ -run TestAccOrganizationRolePermission -v

🤖 Generated with Claude Code

…mission resource

Add three new Terraform types for managing WorkOS permissions:
- workos_permission: CRUD resource for environment-level permissions
- workos_permission (data source): lookup existing permissions by slug
- workos_organization_role_permission: join resource assigning a permission to an org role

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sionsmith added a commit that referenced this pull request Mar 12, 2026
…sion

feat: add permission resource, data source, and organization role permission resource
@sionsmith

Copy link
Copy Markdown
Contributor

Merged manually after rebasing onto main (which now includes #10 domain uniqueness validation and #7 external_id/metadata).

During review, two additional fixes were applied before merging:

  1. updated_at drift fix — Added useStateForUnknownIfConfigUnchanged plan modifier to the permission resource's updated_at attribute. Without this, every terraform plan would show a spurious diff on updated_at (same class of bug fixed in other resources by PR fix: prevent updated_at drift on re-apply #6).

  2. omitempty removal on PermissionUpdateRequest — Removed omitempty from Name and Description JSON tags so that clearing the description to an empty string actually sends the empty value to the API, rather than omitting the field entirely.

All builds and tests pass.

@sionsmith sionsmith closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants