Skip to content

fix: delete a list of default permission rules - #1928

Merged
jacalata merged 2 commits into
tableau:developmentfrom
ranjithguggilla:fix/783-default-permission-delete-list
Dec 2, 2026
Merged

jacalata merged 2 commits into
tableau:developmentfrom
ranjithguggilla:fix/783-default-permission-delete-list

Conversation

@ranjithguggilla

@ranjithguggilla ranjithguggilla commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #783

Motivation

PermissionsEndpoint.delete accepts one rule or a list. delete_default_permission accepted only one PermissionsRule, so a caller with several default rules had to delete them one at a time. Jac Fitzgerald asked for the same list behavior as the regular delete method.

Behavior change

delete_workbook_default_permissions and the other default-permission delete methods, including Databases.delete_table_default_permissions, accept a list of rules as well as a single rule. Passing one rule behaves as before. Each capability is still its own DELETE, which is what the REST API supports. If one DELETE fails partway through the list, the earlier rules are already deleted. The parameter name stays rule, so existing keyword callers stay valid.

Test plan

test_delete_workbook_default_permissions_accepts_a_list deletes two group rules and checks that both DELETE requests are sent. test_delete_table_default_permissions_accepts_a_list does the same for a database. The existing single-rule project test still passes.

Not covered: a call against a live Tableau Server.

delete_default_permission only accepted one PermissionsRule, so a caller
with several default rules had to delete them one at a time. It now
accepts a list, matching PermissionsEndpoint.delete.
@jacalata

jacalata commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for this, @ranjithguggilla. Accepting a list of rules matches what #783 asks for. A couple of changes are needed.

Please fix: docstrings (projects_endpoint.py, all eight delete_*_default_permissions methods)

  • The summary line was updated, but the Parameters section still says rule : PermissionsRule / "The permissions rule to delete from the project." Could you document PermissionsRule | Sequence[PermissionsRule] in each?
  • rules = [rule] if isinstance(rule, PermissionsRule) else list(rule) follows PermissionsEndpoint.delete. If one DELETE fails partway through the list, the earlier rules are already deleted. Could you add a note about that to the docstring?

Please fix: test the databases method

The list path is tested only through Projects.delete_workbook_default_permissions (test/test_project.py). Databases.delete_table_default_permissions also changed its signature and has no test. Could you add a short case for it?

Drafted with AI assistance (Claude); reviewed and posted by Jac.

The Parameters sections still described a single PermissionsRule. Each
delete method now says it takes one rule or a sequence, and that a failed
DELETE leaves the earlier rules already removed. Databases gets the same
note and a list test.
Copilot AI balanced review requested due to automatic review settings December 2, 2026 00:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@ranjithguggilla

Copy link
Copy Markdown
Contributor Author

The Parameters section on each project delete_*_default_permissions method now says PermissionsRule | Sequence[PermissionsRule]. There are nine of those methods, including table, and all nine had the old single-rule text. Each docstring also says that REST deletes one capability per request, and that a failure partway through the list leaves the earlier rules already deleted.

Databases.delete_table_default_permissions has the same note. test_delete_table_default_permissions_accepts_a_list sends two group rules and checks both DELETE requests. The argument order stays (rule, item).

@jacalata jacalata left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@jacalata
jacalata merged commit 46f18a5 into tableau:development Dec 2, 2026
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete default permissions does not take in a list

3 participants