Skip to content

improvement(admin): filter out banned users#5659

Merged
icecrasher321 merged 2 commits into
stagingfrom
improvement/admin-filter
Jul 14, 2026
Merged

improvement(admin): filter out banned users#5659
icecrasher321 merged 2 commits into
stagingfrom
improvement/admin-filter

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

Filter out banned users from banned dashboard. Crowding out the entire board.

Type of Change

  • Other: UX improvement

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 14, 2026 1:21am

Request Review

@cursor

cursor Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Admin list filtering is read-only UX with straightforward SQL; the workflow change is test-only in this diff.

Overview
The admin Users dashboard no longer lists accounts that are actively banned, using the same rules as Better Auth: permanent bans and temporary bans that have not expired are excluded; expired temporary bans show up again. The filter is applied in listDashboardUsers via a SQL visibleUser predicate on both the row query and the count, so pagination totals stay aligned with what admins see.

The same PR adds workflow handler test coverage for published custom blocks: when a consumer runs a custom block from another workspace, the child executor is expected to bill under the source owner/workspace (resolveBillingAttribution on the publisher), not the parent’s attribution, with mocks for getCustomBlockAuthority and environment loading.

Reviewed by Cursor Bugbot for commit ef3df5c. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR filters active bans out of the admin dashboard user list. The main changes are:

  • Adds an active-ban predicate to dashboard user queries.
  • Applies the same filter to pagination totals and row results.
  • Adds workflow handler test coverage for custom-block billing attribution.

Confidence Score: 4/5

The dashboard ban filter has one timezone-sensitive path to fix before merging.

  • The row and count queries use the same filter, so pagination stays consistent.
  • The test-only mock changes match the imports used by the workflow handler.
  • The ban-expiry comparison can produce incorrect dashboard visibility when timestamp storage and database session timezone differ.

apps/sim/lib/admin/dashboard.ts

Security Review

The new admin dashboard ban filter can misclassify temporary bans if ban_expires is compared through the database session timezone.

Important Files Changed

Filename Overview
apps/sim/lib/admin/dashboard.ts Adds active-ban filtering to the dashboard user query, with a timezone-sensitive expiry comparison.
apps/sim/executor/handlers/workflow/workflow-handler.test.ts Adds focused mocks and test coverage for custom-block billing attribution behavior.

Reviews (1): Last reviewed commit: "improvement(admin): filter out banned us..." | Re-trigger Greptile

Comment thread apps/sim/lib/admin/dashboard.ts
@icecrasher321 icecrasher321 merged commit c7151a1 into staging Jul 14, 2026
16 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/admin-filter branch July 14, 2026 01:27
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.

1 participant