• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

raystack / frontier / 27118136958
43%
main: 43%

Build:
Build:
LAST BUILD BRANCH: fix/permission-delete-cascade
DEFAULT BRANCH: main
Ran 08 Jun 2026 05:40AM UTC
Jobs 1
Files 276
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Jun 2026 05:32AM UTC coverage: 43.223% (-0.001%) from 43.224%
27118136958

Pull #1685

github

whoAbhishekSah
fix(permission): cascade role->permission tuple cleanup on delete

permission.Delete only removed the DB row. Every role granting the
permission keeps app/role:<role>#<slug>@<*> tuples (one per principal
type), so deleting a permission left those tuples dangling on a relation no
longer backed by any permission row. The method was also unreachable: the
DeletePermission RPC was hardwired to "function not available".

Changes:
- permission.Service gains a relation dependency and, on Delete, sweeps the
  role->permission tuples by object-namespace (app/role) + relation-name
  (the permission slug), clearing them across all roles and principal types
  before removing the row. Tolerates ErrNotExist for unused permissions.
- Implement the DeletePermission admin handler and gate it on superuser
  (previously returned CodeUnavailable), making the guard reachable and
  giving the data-cleanup effort a way to remove stray permissions.

Adds an e2e regression test: create a permission, build a role on it,
delete the permission, assert no role->permission tuple remains. Verified
it fails without the sweep (tuple lingers) and passes with it.

Refs #1661

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pull Request #1685: fix(permission): cascade role→permission tuple cleanup on delete

18 of 41 new or added lines in 4 files covered. (43.9%)

85 existing lines in 5 files now uncovered.

16458 of 38077 relevant lines covered (43.22%)

12.13 hits per line

Uncovered Changes

Lines Coverage ∆ File
17
72.83
-7.94% internal/api/v1beta1connect/permission.go
3
0.0
0.0% cmd/serve.go
2
95.24
-4.76% core/permission/service.go
1
0.0
0.0% pkg/server/connect_interceptors/authorization.go

Coverage Regressions

Lines Coverage ∆ File
53
12.0
0.0% internal/bootstrap/service.go
11
0.0
0.0% internal/store/spicedb/relation_repository.go
10
0.0
0.0% cmd/serve.go
9
72.83
-7.94% internal/api/v1beta1connect/permission.go
2
95.24
-4.76% core/permission/service.go
Jobs
ID Job ID Ran Files Coverage
1 27118136958.1 08 Jun 2026 05:40AM UTC 276
43.22
GitHub Action Run
Source Files on build 27118136958
  • Tree
  • List 276
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #1685
  • PR Base - main (#27116164446)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc