trypost/tests/Unit
Paulo Castellano 5bb39da598 fix(permissions): enforce workspace roles across backend and UI
Viewers could mutate posts, automations and trigger AI write endpoints,
and every role saw create/manage affordances that 403'd on click.

Backend (security):
- PostPolicy update/delete now require member+ (was tenancy-only), which
  also gates the AI write endpoints that authorize('update')
- AutomationPolicy create/update/delete require member+; activate/pause
  delegate to update
- AutomationController authorizes index/store/show; AnalyticsController
  authorizes view
- Comments stay open to members incl. viewer (by design)

Frontend (UI gating via new useWorkspaceRole composable):
- Sidebar: create post / create workspace / automations / library nav
- Accounts grid: connect / disconnect / reconnect (admin+)
- Members: invite / change role / remove / cancel invite (admin+)
- Account billing tab (owner); posts index + calendar create affordances

Tests: PostPolicyTest, AutomationPolicyTest (all four roles) and an
end-to-end WorkspaceRolePermissionsTest; aligned the automation test
suites' account/workspace setup with role pivots.
2026-06-22 16:31:54 -03:00
..
Ai/Agents refactor(ai): introduce GeneratorFormat enum and drop stringly-typed format 2026-06-18 11:11:23 -03:00
Automation test(automations): extract inline feed XML into shared fixtures 2026-06-16 11:06:46 -03:00
Broadcasting feat: workspace-scoped broadcast channel and post lifecycle events 2026-05-07 16:02:22 -03:00
Enums refactor: address code review for per-workspace pricing 2026-06-21 21:28:47 -03:00
Events refactor: prefer string interpolation over concatenation for channel names 2026-05-08 19:22:01 -03:00
Exceptions/Social Add return type to telegram exception test helper 2026-06-13 22:58:04 -03:00
Mail feat: @mentions in comments, AI Action layer + MCP tools, settings tabs 2026-05-01 20:59:03 -03:00
Models chore: remove legacy plan tiers (starter/plus/pro/max) 2026-06-22 15:31:32 -03:00
Policies fix(permissions): enforce workspace roles across backend and UI 2026-06-22 16:31:54 -03:00
PostTemplates refactor: reorganize settings UI, migrate post templates to a file-based registry, and remove legacy video generation features 2026-05-03 13:44:13 -03:00
Rules chore: remove unused Pennant package and dead user-timezone handling 2026-06-22 13:37:38 -03:00
Services Group Telegram service classes under Services/Social/Telegram 2026-06-14 13:32:03 -03:00
Socialite refactor: settings redesign, Spanish translations, language system, strict_types 2026-03-30 00:20:43 -03:00
Support refactor(posts): replace PostStatusGuard with PostStatusRules for editing and deletion checks 2026-05-21 19:32:42 -03:00
Traits refactor: centralize media size limits in config + drop Document type 2026-05-04 14:54:47 -03:00
ExampleTest.php refactor: settings redesign, Spanish translations, language system, strict_types 2026-03-30 00:20:43 -03:00
HelpersTest.php refactor: settings redesign, Spanish translations, language system, strict_types 2026-03-30 00:20:43 -03:00
MediaPolymorphTest.php fix: persist morph map alias on AI-generated Media rows 2026-05-04 14:14:14 -03:00
MorphMapTest.php Register all models in the morph map + lock it with a test 2026-06-14 16:12:49 -03:00
PostHogServiceTest.php chore: remove legacy plan tiers (starter/plus/pro/max) 2026-06-22 15:31:32 -03:00
PostPlatformTest.php fix(facebook): empty-message rejection + state consistency + no re-publish on terminal 2026-05-19 12:47:18 -03:00