Skip to content

Latest commit

 

History

History
90 lines (70 loc) · 3.18 KB

File metadata and controls

90 lines (70 loc) · 3.18 KB

Role Access Policy

Overview

This application implements a fully open access policy - all authenticated users, regardless of their role, have complete and equal access to all features and functionality.

Access Model

Authentication-Based Access

  • Protected Routes: Only require user authentication (login)
  • No Role Checks: Routes do not check user roles before granting access
  • Equal Permissions: All authenticated users have identical permissions

Available Roles

The application supports the following user roles (for organizational purposes only):

  • admin - Administrative user
  • manager - Management user
  • user - Standard user

Note: These roles are for display and organizational purposes only. They do not restrict access to any features.

Employee Roles (Separate from User Roles)

Employee roles are for categorizing staff members:

  • detailer - Detailer/Washer
  • manager - Manager
  • director - Director

These are employee classifications and do not affect app access.

Full Feature Access

All authenticated users can:

  • ✅ Access all pages (Dashboard, Appointments, Customers, Vehicles, Services, Employees, Inventory, Routes, Reports, Settings, Diagnostics)
  • ✅ Create, edit, and delete all data types
  • ✅ View all reports and analytics
  • ✅ Modify settings and configuration
  • ✅ Export and import data
  • ✅ Access diagnostics and system information
  • ✅ Use all sync features
  • ✅ Manage employees and clock in/out
  • ✅ Create and manage appointments
  • ✅ Access AI Assistant

Implementation Details

ProtectedRoute Component

function ProtectedRoute({ children }: { children: ReactNode }) {
  const { currentUser } = useStore();
  return currentUser ? <>{children}</> : <Navigate to="/signin" replace />;
}
  • Only checks if user is logged in
  • Does not check user role
  • All authenticated users pass this check

Navigation

  • All navigation items are visible to all users
  • No role-based hiding of menu items
  • All routes are accessible to all authenticated users

Data Operations

  • All CRUD operations are available to all users
  • No role-based restrictions on:
    • Creating records
    • Editing records
    • Deleting records
    • Viewing data

Settings & Configuration

  • All settings are accessible to all users
  • No restricted configuration options
  • Full access to sync settings, branding, and preferences

Why This Design?

  1. Simplicity: Easier to maintain without complex permission systems
  2. Flexibility: Teams can organize themselves without technical restrictions
  3. Trust-Based: Relies on organizational policies rather than technical barriers
  4. Collaboration: Enables full team collaboration without access limitations

Future Considerations

If role-based restrictions are needed in the future, they can be added by:

  1. Creating a permission system
  2. Adding role checks to ProtectedRoute
  3. Conditionally rendering features based on roles
  4. Restricting specific actions based on user role

Currently, the application prioritizes ease of use and full collaboration over access restrictions.