# Role Permission Dashboard

**Date:** 2026-07-23  
**Developer:** Jeetendra Maharjan  
**Status:** In Progress

---

## Summary
Add Dashboard as a selectable permission in Roles & Permissions, driven by the admin sidebar permission tree.

---

## Changes Made

### 1 — Add Dashboard to role permissions
- **File(s) affected:** `config/admin-sidebar.php`, `app/Services/PermissionRegistry.php`
- **What was done:** Added Dashboard as a top-level sidebar link (`route: dashboard`) so it appears in the Roles & Permissions module grid; included `view` in sidebar allowed actions so `dashboard.view` is selectable.
- **Why:** Role permissions are derived from the admin sidebar; Dashboard existed as a route/permission but was omitted from the sidebar config and `view` was not in the allowed action list.

### 2 — Logout redirect to systemadmin
- **File(s) affected:** `app/Http/Controllers/Backend/Auth/AuthenticatedSessionController.php`, `tests/Feature/Auth/AuthenticationTest.php`
- **What was done:** Changed logout redirect from `/` to `/systemadmin` (which then routes to the login screen).
- **Why:** After admin logout, users should land on the admin entry point, not the public frontend home.

### 6 — Header user menu
- **File(s) affected:** `resources/views/components/backend-layout.blade.php`
- **What was done:** Removed the top-right notification icon; made the user avatar a dropdown with Account and Log out (same routes/actions as the sidebar footer links).
- **Why:** Notification control was unused; avatar needed to expose account actions.

---

## Decisions & Notes
- Dashboard uses route name `dashboard` → permission `dashboard.view` (existing DB row).
- Logout targets `/systemadmin` specifically so the URL matches the admin area entry.
- Profile is intentionally outside role permissions: any logged-in user can manage their own account.

---

## Pending / Follow-up
- [ ] Confirm Dashboard appears in role create/edit permission grid
- [ ] Confirm non–super-admin users with Dashboard permission can access `/systemadmin/dashboard`
- [ ] Assign Dashboard permission to existing non–super-admin roles that should retain dashboard access
- [ ] Confirm Account link and `/systemadmin/profile` work for non–super-admin users
