[MokoJoomMembership] [FEATURE] AccessService -- Joomla user group sync #52

Open
opened 2026-06-02 19:35:55 +00:00 by jmiller · 1 comment
Owner

Migrated from MokoJoomMembership#58

Summary

Manages Joomla user group assignments based on active subscriptions.

Responsibilities

  • Add user to plan's Joomla user group when subscription activates
  • Remove user from group when subscription expires/cancels
  • Batch sync all users (repair mismatches)
  • Check if user has active access to a specific group

Location

admin/src/Service/AccessService.php

Key Methods

  • grantAccess(int $userId, int $planId): void
  • revokeAccess(int $userId, int $planId): void
  • syncAll(): array
  • hasAccess(int $userId, int $planId): bool

Notes

This is the core mechanism for content restriction via standard Joomla ACL. The plans table has a user_group_id column for this purpose.

> Migrated from MokoJoomMembership#58 ## Summary Manages Joomla user group assignments based on active subscriptions. ## Responsibilities - Add user to plan's Joomla user group when subscription activates - Remove user from group when subscription expires/cancels - Batch sync all users (repair mismatches) - Check if user has active access to a specific group ## Location `admin/src/Service/AccessService.php` ## Key Methods - `grantAccess(int $userId, int $planId): void` - `revokeAccess(int $userId, int $planId): void` - `syncAll(): array` - `hasAccess(int $userId, int $planId): bool` ## Notes This is the core mechanism for content restriction via standard Joomla ACL. The plans table has a `user_group_id` column for this purpose.
jmiller added the membership label 2026-06-02 19:52:09 +00:00
Author
Owner

Built: AccessService already fully implemented (72 lines) — addUserToGroup, hasActiveSubscription.

Built: AccessService already fully implemented (72 lines) — addUserToGroup, hasActiveSubscription.
jmiller added the pending: testing label 2026-06-02 20:31:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomCommunity#52