From 3ed9379e83d9daf041a1b9efe3bfe0f7a193baed Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 08:46:36 +0200 Subject: [PATCH] feat(role-permissions-page): Admin-Page zum Anzeigen welche Permissions welche Rolle hat [tsc:fail] --- .phase25-state.json | 5 +- GENERATION_LOG.md | 18 ++++ apps/web/src/pages/RolePermissions.tsx | 124 +++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 apps/web/src/pages/RolePermissions.tsx diff --git a/.phase25-state.json b/.phase25-state.json index 7b78acd..1d4410d 100644 --- a/.phase25-state.json +++ b/.phase25-state.json @@ -1,9 +1,10 @@ { "completed_features": [], - "current_feature": "holiday-calendar", + "current_feature": "role-permissions-page", "started_at": "2026-05-23T08:41:41.344530", "attempted_features": [ "working-hours-config", - "default-project-per-customer" + "default-project-per-customer", + "holiday-calendar" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 000a8ae..8e38bc2 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -2938,3 +2938,21 @@ src/index.ts(27,25): error TS2769: No overload matches this call. Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Type 'Promise' provides no match for the signature '(instance: FastifyInstance, +- `08:45:57` **INFO** Committed feature holiday-calendar +- `08:45:58` **INFO** Pushed: rc=0 + +## Phase-3 Feature: role-permissions-page (2026-05-23 08:45:58) + +- `08:45:58` **INFO** Description: Admin-Page zum Anzeigen welche Permissions welche Rolle hat (Read-only Matrix) +- `08:45:58` **INFO** Generating apps/web/src/pages/RolePermissions.tsx (RolePermissions-Page (admin-only). Statische Tabelle: Spalten Admin/Us…) +- `08:46:34` **INFO** wrote 4181 chars in 36.4s (attempt 1) +- `08:46:34` **INFO** Running tsc --noEmit on api… +- `08:46:36` **WARN** tsc errors: +src/db/schema.ts(37,14): error TS7022: 'customers' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +src/db/schema.ts(43,59): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +src/db/schema.ts(47,14): error TS7022: 'projects' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +src/db/schema.ts(51,56): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +src/index.ts(27,25): error TS2769: No overload matches this call. + Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, diff --git a/apps/web/src/pages/RolePermissions.tsx b/apps/web/src/pages/RolePermissions.tsx new file mode 100644 index 0000000..d020248 --- /dev/null +++ b/apps/web/src/pages/RolePermissions.tsx @@ -0,0 +1,124 @@ +import React from 'react'; +import { createFileRoute } from '@tanstack/react-router'; +import { ShieldCheck, Lock } from 'lucide-react'; + +type Permission = { + id: string; + label: string; + description: string; + roles: { + admin: boolean; + user: boolean; + }; +}; + +const PERMISSIONS_DATA: Permission[] = [ + { + id: 'view_dashboard', + label: 'View Dashboard', + description: 'Access to the main overview and statistics', + roles: { admin: true, user: true }, + }, + { + id: 'edit_own_entries', + label: 'Edit Own Entries', + description: 'Modify records created by the current user', + roles: { admin: true, user: true }, + }, + { + id: 'manage_users', + label: 'Manage Users', + description: 'Create, edit, and delete user accounts', + roles: { admin: true, user: false }, + }, + { + id: 'configure_settings', + label: 'Configure Settings', + description: 'Change global application configurations', + roles: { admin: true, user: false }, + }, + { + id: 'view_audit_log', + label: 'View Audit Log', + description: 'Access to system-wide activity logs', + roles: { admin: true, user: false }, + }, +]; + +export const Route = createFileRoute('/role-permissions')({ + component: RolePermissionsPage, +}); + +function RolePermissionsPage() { + return ( +
+
+
+ +
+
+

Role Permissions

+

Reference guide for system access levels

+
+
+ +
+ + + + + + + + + + {PERMISSIONS_DATA.map((perm) => ( + + + + + + ))} + +
PermissionAdminUser
+
{perm.label}
+
{perm.description}
+
+ + + +
+
+ +
+ +

+ Note: This is a read-only documentation view. Permissions are hard-coded + in the system core and cannot be modified via the UI. +

+
+
+ ); +} + +function PermissionCheck({ active }: { active: boolean }) { + return ( +
+ {active ? ( +
+ + + +
+ ) : ( +
+ )} +
+ ); +} \ No newline at end of file