Skip to content

[comp] Production Deploy#2848

Merged
Marfuen merged 4 commits into
releasefrom
main
May 14, 2026
Merged

[comp] Production Deploy#2848
Marfuen merged 4 commits into
releasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 14, 2026

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.


Summary by cubic

Fix portal access by resolving RBAC across all roles and remove default portal access/compliance from admins. Users without access now see a clear in-app message instead of a redirect loop.

  • Bug Fixes

    • Resolve access by merging built-in and DB custom role permissions; allow if portal actions exist or compliance is required. Unknown roles (e.g. member) are ignored, not denied.
    • Update @trycompai/auth: remove portal permissions and compliance obligation from admin; keep owner compliance. Enforce finding read/update-only for owner/admin.
    • Show an in-page “No access” message on the org home instead of redirecting; remove the stray use server directive.
  • Migration

    • If admins need portal access, add the employee role to their account.

Written for commit 9316c6d. Summary will update on new commits.

github-actions Bot and others added 4 commits May 13, 2026 23:44
The AWS Auditor CloudShell script used `cat <<EOF ... EOF` to build the
trust policy. If copy/paste mangled the EOF marker (whitespace added,
line concatenated, or content truncated), bash kept reading lines
looking for EOF, hit end-of-file, and failed with:

  here-document at line 71 delimited by end-of-file (wanted 'EOF')
  command substitution: line 105: unexpected EOF while looking for matching ')'

Replaced the heredoc with inline single-quoted JSON, matching the
Remediation script's existing pattern. Same IAM role, same policies,
same trust relationship — byte-identical commands sent to AWS, just
delivered via a more robust bash syntax.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(portal): resolve RBAC permissions instead of checking role names

The previous hasPortalAccess checked role names against
BUILT_IN_ROLE_PERMISSIONS — unrecognized roles (like better-auth's
default "member") caused false denials. Now resolves the user's full
RBAC permissions by merging all roles (built-in + custom from DB),
then checks for portal:read or compliance obligation.

Also removes incorrect 'use server' directive.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(auth): remove compliance obligation from owner and admin roles

Owner and admin roles manage compliance — they don't complete compliance
tasks themselves. Users who need to complete employee tasks (sign
policies, watch training, install device agent) should have the
employee role added explicitly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(auth): restore compliance obligation for owner role

Owners are typically the initial user and should complete compliance
tasks by default. Admins still need the employee role added explicitly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(auth): remove portal permissions from admin role

Admins manage compliance through the main app — they don't need portal
access by default. Add the employee role to grant portal access and
compliance tasks, matching the CX team's workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(portal): show access denied message instead of redirect loop

When a user lacks portal access, render a clear message telling them
to ask their admin for the employee role — instead of redirecting to /
which would loop back to the org page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test(rbac): add portal access matrix tests and fix permission regression tests

Add portal-access.spec.ts verifying the role → portal access matrix:
employee/contractor/owner → ALLOW, admin/auditor/member → DENY,
admin+employee → ALLOW. Prevents regressions in portal gating logic.

Update permissions-regression.spec.ts: admin no longer has portal or
compliance, finding is read/update only for owner/admin (not full CRUD),
fix ESM mocks for better-auth server imports.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

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

Project Deployment Actions Updated (UTC)
app (staging) Ready Ready Preview, Comment May 14, 2026 5:18pm
comp-framework-editor (staging) Ready Ready Preview, Comment May 14, 2026 5:18pm
portal (staging) Ready Ready Preview, Comment May 14, 2026 5:18pm

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@Marfuen Marfuen merged commit 543aa06 into release May 14, 2026
14 checks passed
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.54.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

3 participants