[PR #7687] [MERGED] fix(access): allow passing statements directly into newRole #15741

Closed
opened 2026-04-13 10:12:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7687
Author: @jslno
Created: 1/29/2026
Status: Merged
Merged: 1/29/2026
Merged by: @Bekacru

Base: canaryHead: 01-29-2026/ac-types


📝 Commits (2)

  • c8a5437 fix(access): allow passing statements directly into newRole
  • e66c8e5 chore: cleanup

📊 Changes

2 files changed (+13 additions, -3 deletions)

View changed files

📝 packages/better-auth/src/plugins/access/access.test.ts (+11 -2)
📝 packages/better-auth/src/plugins/access/types.ts (+2 -1)

📄 Description

closes #7681


Summary by cubic

Allow passing the full statements object directly into newRole in the access control plugin. Fixes the type restriction and satisfies Linear #7681.

  • Bug Fixes
    • Updated newRole to accept either a subset of statements or the full TStatements.
    • Added a test to verify authorization works when passing the defined statements object.

Written for commit e66c8e542c. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7687 **Author:** [@jslno](https://github.com/jslno) **Created:** 1/29/2026 **Status:** ✅ Merged **Merged:** 1/29/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `01-29-2026/ac-types` --- ### 📝 Commits (2) - [`c8a5437`](https://github.com/better-auth/better-auth/commit/c8a5437afbe3e771784f4186956c9f45de9a0e58) fix(access): allow passing statements directly into `newRole` - [`e66c8e5`](https://github.com/better-auth/better-auth/commit/e66c8e542c150c76832e79f4bd74bb23b64475df) chore: cleanup ### 📊 Changes **2 files changed** (+13 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/access/access.test.ts` (+11 -2) 📝 `packages/better-auth/src/plugins/access/types.ts` (+2 -1) </details> ### 📄 Description closes #7681 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Allow passing the full statements object directly into newRole in the access control plugin. Fixes the type restriction and satisfies Linear #7681. - **Bug Fixes** - Updated newRole to accept either a subset of statements or the full TStatements. - Added a test to verify authorization works when passing the defined statements object. <sup>Written for commit e66c8e542c150c76832e79f4bd74bb23b64475df. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 10:12:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#15741