fix: allow admin role to access triage and investigation pages
Role guard was hse-only — admin was redirected to inbox on click. Both triage and investigation now accept hse or admin. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CPf5Rc8QPx6V8KLEEgfKEQ
This commit is contained in:
@@ -18,7 +18,7 @@ export default async function InvestigationPage({ params }: Props) {
|
||||
|
||||
const { data: profile } = await supabase
|
||||
.from('users').select('role').eq('id', data.user.id).single()
|
||||
if (!profile || profile.role !== 'hse') redirect('/hse/incidents')
|
||||
if (!profile || !['hse', 'admin'].includes(profile.role)) redirect('/hse/incidents')
|
||||
|
||||
const { data: incident } = await supabase
|
||||
.from('incidents')
|
||||
|
||||
Reference in New Issue
Block a user