feat: Add event co-managers permissions and allow managers/admins to signup guests on skill-restricted shifts

This commit is contained in:
Richard
2026-07-31 11:06:47 +02:00
parent 821e14fcab
commit e2b311b634
23 changed files with 589 additions and 485 deletions
+2 -1
View File
@@ -136,7 +136,8 @@ export default function HomePage({
{filteredEvents.map((evt) => {
const taskAreaCount = evt.task_areas?.length || 0;
const totalShifts = evt.task_areas?.reduce((acc, ta) => acc + (ta.shifts?.length || 0), 0) || 0;
const isCreator = user && (evt.created_by === user.id || evt.created_by?.id === user.id);
const isCoManager = user && evt.co_managers && evt.co_managers.some(cm => (typeof cm === 'object' ? cm.id === user.id : cm === user.id));
const isCreator = user && (evt.created_by === user.id || evt.created_by?.id === user.id || isCoManager);
const canManage = isUserAdmin || isCreator;
return (