╔══════════════════════════════════════════════════════════════╗
║         Permission Auto-Fix Script                          ║
╚══════════════════════════════════════════════════════════════╝

🔍 DRY RUN MODE - No files will be modified

⚠️  Skipping AITestController (test controller - should be removed)
📄 Processing AccountController...
📄 Processing AccountingController...
📄 Processing ActionMenuEditorController...
📄 Processing ActivityController...
⏭️  Skipping AgreementController (intentionally public)
📄 Processing AgreementTemplateController...
📄 Processing AnalyticsController...
📄 Processing AnnouncementController...
📄 Processing ApiController...
  ✓ Would fix allUsers() - add: api.view
  ✓ Would fix usersList() - add: api.view

📄 Processing ApplicationController...
📄 Processing ApprovalsController...
📄 Processing AssessmentController...
📄 Processing AssumptionsController...
📄 Processing AttendanceController...
📄 Processing AuditLogController...
⏭️  Skipping AuthController (intentionally public)
📄 Processing BOMController...
📄 Processing BackupController...
  ✓ Would fix showDetails() - add: backup.view
  ✓ Would fix getStats() - add: backup.view
  ✓ Would fix getHistory() - add: backup.view
  ✓ Would fix triggerFullBackup() - add: backup.view
  ✓ Would fix triggerGitPush() - add: backup.view
  ✓ Would fix triggerDatabaseBackup() - add: backup.view
  ✓ Would fix index() - add: backup.view

📄 Processing BankAccountController...
📄 Processing BankImportController...
📄 Processing BankReconciliationController...
📄 Processing BatteryQuoteController...
📄 Processing BudgetController...
📄 Processing BusinessLineController...
📄 Processing CRMController...
📄 Processing CalendarController...
📄 Processing CameraAuditController...
📄 Processing CapacityController...
📄 Processing CategoryController...
📄 Processing ClientController...
📄 Processing CompanyController...
📄 Processing ContactAPIController...
📄 Processing ContactController...
📄 Processing ContractController...
📄 Processing CostingController...
📄 Processing CreditNoteController...
📄 Processing CurrencyController...
📄 Processing CustomReportsController...
  ✓ Would fix index() - add: reports.view

📄 Processing CustomerController...
📄 Processing CustomerPaymentController...
📄 Processing DashboardController...
📄 Processing DataAccessController...
📄 Processing DebitNoteController...
📄 Processing DeliveryNoteController...
📄 Processing DepreciationController...
📄 Processing DocumentController...
📄 Processing DocumentationController...
  ✓ Would fix refreshCoverage() - add: documentation.view
  ✓ Would fix download() - add: documentation.export
  ✓ Would fix search() - add: documentation.view
  ✓ Would fix index() - add: documentation.view

📄 Processing DocumentsController...
📄 Processing EmailController...
📄 Processing EmailTemplateController...
📄 Processing EmailWebhookController...
  ✓ Would fix test() - add: email.view
  ✓ Would fix receive() - add: email.view

📄 Processing EmployeeController...
📄 Processing EquipmentController...
📄 Processing EquipmentLineController...
📄 Processing EquipmentTypeController...
📄 Processing ExpenseController...
📄 Processing FileManagerController...
📄 Processing FinancialPlannerController...
📄 Processing FinancialProFormaController...
📄 Processing FixedAssetController...
📄 Processing ForecasterController...
📄 Processing Form1099Controller...
📄 Processing GoodsReceiptController...
📄 Processing HRController...
📄 Processing HelpDeskController...
📄 Processing InternalNoteAPIController...
📄 Processing InterviewController...
📄 Processing InventoryController...
📄 Processing InvoiceController...
📄 Processing IssueController...
📄 Processing JobPositionController...
📄 Processing JournalEntryController...
📄 Processing LocationController...
📄 Processing LotSerialController...
📄 Processing MFAController...
  ✓ Would fix resendOTP() - add: security.view
  ✓ Would fix verify() - add: security.approve
  ✓ Would fix verifyForm() - add: security.approve

📄 Processing MRPController...
📄 Processing MachineDataController...
  ✓ Would fix health() - add: machine_data.view
  ✓ Would fix getStatus() - add: machine_data.view

📄 Processing MaintenanceController...
📄 Processing ManufacturingController...
📄 Processing MenuController...
📄 Processing MessagingController...
📄 Processing NDAController...
  ✓ Would fix declineNDA() - add: nda.view
  ✓ Would fix signNDA() - add: nda.view
  ✓ Would fix publicSign() - add: nda.view

📄 Processing NDATemplateController...
📄 Processing NetworkMonitorController...
  ✓ Would fix logDetail() - add: network_monitor.view
  ✓ Would fix feed() - add: network_monitor.view
  ✓ Would fix statistics() - add: network_monitor.view
  ✓ Would fix logs() - add: network_monitor.view
  ✓ Would fix status() - add: network_monitor.view

📄 Processing NextcloudAdminController...
📄 Processing NextcloudController...
  ✓ Would fix viewDocument() - add: nextcloud.view

📄 Processing NextcloudProxyController...
📄 Processing NextcloudSSOController...
  ✓ Would fix validateToken() - add: nextcloud_sso.view

📄 Processing NotificationController...
  ✓ Would fix delete() - add: notifications.delete
  ✓ Would fix markAllAsRead() - add: notifications.view
  ✓ Would fix markAsRead() - add: notifications.view
  ✓ Would fix getUnread() - add: notifications.view

📄 Processing OfferController...
📄 Processing OpportunityController...
📄 Processing PaymentController...
📄 Processing PayrollController...
📄 Processing PeriodClosingController...
📄 Processing PermissionGroupController...
📄 Processing PipedriveImportController...
  ✓ Would fix getStats() - add: pipedrive_import.view
  ✓ Would fix viewLog() - add: pipedrive_import.view
  ✓ Would fix index() - add: pipedrive_import.view

📄 Processing PositionController...
📄 Processing PricingRuleController...
  ✓ Would fix calculatePrice() - add: pricing_rule.view

📄 Processing ProFormaController...
  ✓ Would fix calculate() - add: pro_forma.view

📄 Processing ProductController...
📄 Processing ProductForecastController...
  ✓ Would fix gettingStarted() - add: product_forecast.view

📄 Processing ProfileController...
📄 Processing ProjectsController...
  ✓ Would fix addTaskComment() - add: projects.create
  ✓ Would fix getTaskComments() - add: projects.view
  ✓ Would fix autoAllocateResources() - add: projects.view
  ✓ Would fix resourceDayDetails() - add: projects.view
  ✓ Would fix resources() - add: projects.view
  ✓ Would fix addTaskDependency() - add: projects.create
  ✓ Would fix calculateCriticalPath() - add: projects.view
  ✓ Would fix gantt() - add: projects.view
  ✓ Would fix processMigration() - add: projects.view
  ✓ Would fix migrateTransactions() - add: projects.view
  ✓ Would fix linkTransactionToTask() - add: projects.view
  ✓ Would fix editTransaction() - add: projects.edit
  ✓ Would fix storeTransaction() - add: projects.create
  ✓ Would fix createTransaction() - add: projects.create
  ✓ Would fix financials() - add: projects.view
  ✓ Would fix unassignGroupFromTask() - add: projects.view
  ✓ Would fix assignGroupToTask() - add: projects.view
  ✓ Would fix addTeamGroup() - add: projects.create
  ✓ Would fix addTeamMember() - add: projects.create
  ✓ Would fix toggleChecklistItem() - add: projects.view
  ✓ Would fix addChecklistItem() - add: projects.view
  ✓ Would fix unassignUser() - add: projects.view
  ✓ Would fix assignUser() - add: projects.view
  ✓ Would fix addComment() - add: projects.create
  ✓ Would fix getTask() - add: projects.view
  ✓ Would fix moveTask() - add: projects.view
  ✓ Would fix listView() - add: projects.view
  ✓ Would fix show() - add: projects.view
  ✓ Would fix index() - add: projects.view
  ✓ Would fix myTasks() - add: projects.view
  ✓ Would fix dashboard() - add: projects.view

📄 Processing PromotionController...
  ✓ Would fix applyPromotion() - add: promotion.view
  ✓ Would fix validateCode() - add: promotion.view

📄 Processing PurchaseBillController...
📄 Processing PurchaseOrderController...
📄 Processing PurchasePaymentController...
📄 Processing PurchaseRequisitionController...
📄 Processing PurchaseReturnController...
📄 Processing PurchasesController...
📄 Processing QualityController...
📄 Processing QuickBooksController...
📄 Processing QuoteController...
  ✓ Would fix declineQuote() - add: quote.view
  ✓ Would fix acceptQuote() - add: quote.view

📄 Processing QuoteTemplateController...
📄 Processing RFQController...
📄 Processing RecruitmentController...
📄 Processing RecurringTransactionController...
📄 Processing ReportsController...
📄 Processing ReturnController...
  ✓ Would fix complete() - add: return.view

📄 Processing ReviewController...
📄 Processing RoleController...
📄 Processing SalesController...
📄 Processing SalesOrderController...
📄 Processing SalesReportController...
  ✓ Would fix getQuoteConversion() - add: sales.view
  ✓ Would fix getSalesGrowth() - add: sales.view
  ✓ Would fix getCategoryPerformance() - add: sales.view
  ✓ Would fix getPaymentAnalytics() - add: sales.view
  ✓ Would fix getInvoiceAnalytics() - add: sales.view
  ✓ Would fix getByChannel() - add: sales.view
  ✓ Would fix getByStatus() - add: sales.view
  ✓ Would fix getTopCustomers() - add: sales.view
  ✓ Would fix getTopProducts() - add: sales.view
  ✓ Would fix getSummary() - add: sales.view

📄 Processing SchedulingController...
📄 Processing SearchController...
📄 Processing SeparationController...
📄 Processing SettingsController...
📄 Processing ShipmentController...
📄 Processing ShopFloorController...
📄 Processing StockMovementController...
📄 Processing SupplierController...
📄 Processing SupportController...
📄 Processing SystemScriptsController...
📄 Processing TaxFilingController...
📄 Processing TaxJurisdictionController...
📄 Processing TaxPaymentController...
📄 Processing TermsConditionsController...
⚠️  Skipping TestController (test controller - should be removed)
📄 Processing TrainingController...
📄 Processing TransferController...
📄 Processing UserController...
📄 Processing UserGroupController...
📄 Processing VendorPaymentController...
📄 Processing WarehouseController...
📄 Processing WorkOrderController...
═══════════════════════════════════════════════════════════════
SUMMARY
═══════════════════════════════════════════════════════════════
Mode: DRY RUN (no changes made)

✅ Complete!