Skip to content

fix: add error403.blade.php to resolve crash on permission-gated pages#3365

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/create-error403-blade-template
Draft

fix: add error403.blade.php to resolve crash on permission-gated pages#3365
Copilot wants to merge 2 commits intomasterfrom
copilot/create-error403-blade-template

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 15, 2026

Accessing any permission-gated page as a non-owner user crashed with View [error403] not found. The root cause: Template::display('errors.error403') resolves to errors::error403, finds the legacy .tpl.php, then loads the app layout with $module='errors'/$action='error403' — but the App view composer overrides $module with the current request's module (e.g. setting), causing @include("setting::error403") to fail.

Changes

  • app/Domain/Errors/Templates/error403.blade.php — new Blade template for errors::error403

When a .blade.php file is present, Template::display() takes the blade code path: passes $layout directly to the view (not $module/$action), the template extends it, and the layout falls through to @yield('content') — entirely bypassing the App composer override.

@extends($layout)

@section('content')
<div class="errortitle">
    <h4 class="animate0 fadeInUp">{{ __('headlines.page_forbidden') }}</h4>
    <span class="animate1 bounceIn">4</span>
    <span class="animate2 bounceIn">0</span>
    <span class="animate3 bounceIn">3</span>
    ...
</div>
@endsection

Covers all affected controllers: Users, Projects, Clients, Settings, API, Timesheets, Calendar, Sprints, Tickets.

Original prompt

Bug: Accessing any permission-gated page as a non-owner user crashes with View [error403] not found.

Root cause: Multiple controllers call $this->tpl->display('errors.error403', responseCode: 403) but the Blade view file doesn't exist.

Fix needed:

  1. Create app/Views/Templates/errors/error403.blade.php with a clean "403 Access Denied" page.
  2. Use the existing error page layout/styling (check if there's an error404.blade.php or similar template to match).
  3. The template should extend the app layout and display a simple "You don't have permission to access this page" message.

Files to reference:

  • app/Domain/Setting/Controllers/EditCompanySettings.php line 50 — example of the errors.error403 call
  • app/Domain/Errors/Controllers/Error403.php — the old controller-based error handler
  • Look at existing error templates in app/Views/Templates/errors/ for the pattern

This affects all controllers that use the errors.error403 view: Users, Projects, Clients, Settings, API, Timesheets, etc.

Fixes #3323

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Add 403 Access Denied error page template fix: add error403.blade.php to resolve crash on permission-gated pages Apr 15, 2026
Copilot AI requested a review from marcelfolaron April 15, 2026 11:16
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.

Pressing the "Company" button results in error

3 participants