Skip to content

fix the permission note for deleting a sub-account - #41

Merged
oshchyhol merged 4 commits into
mainfrom
fix-sub-account-delete-permission-note
Nov 5, 2026
Merged

oshchyhol merged 4 commits into
mainfrom
fix-sub-account-delete-permission-note

Conversation

@oshchyhol

@oshchyhol oshchyhol commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Deleting an organization sub-account takes admin permissions for the organization. Sub-account management permissions only list and create sub-accounts, so a token that has only those gets 403. The Delete doc comment from #30 still names sub-account management permissions.

Changes

  • SubAccountsService doc comment: says which permission each method needs
  • SubAccounts.Delete doc comment: requires organization admin permissions, not sub-account management permissions; names the 403 when the Organization & Sub-accounts feature is off and the 409 for a concurrent deletion

How to test

  • go doc github.com/mailtrap/mailtrap-go SubAccountsService – reads "List and Create require an organization token with sub-account management permission; Delete requires organization admin permissions"
  • go doc github.com/mailtrap/mailtrap-go SubAccountsService.Delete – reads "It requires organization admin permissions"
  • Delete with a token that has organization admin permissions – resp.StatusCode == 204; with a token that only has sub-account management permissions – error with status 403
  • List and Create with a token that only has sub-account management permissions still work

Images and GIFs

N/A

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8f426fc9-e8b1-4544-bea2-c4f64e394c56
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@oshchyhol
oshchyhol marked this pull request as ready for review November 4, 2026 11:41
@oshchyhol
oshchyhol requested review from Rabsztok and izikaj November 4, 2026 11:42
Comment thread sub_accounts.go Resolved
@oshchyhol
oshchyhol merged commit 65ea5cf into main Nov 5, 2026
4 checks passed
@oshchyhol
oshchyhol deleted the fix-sub-account-delete-permission-note branch November 5, 2026 22:53
@github-actions github-actions Bot mentioned this pull request Nov 9, 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.

3 participants