Skip to content

feat: add player permissions endpoints#19

Open
lusu007 wants to merge 5 commits intomainfrom
feat/permission
Open

feat: add player permissions endpoints#19
lusu007 wants to merge 5 commits intomainfrom
feat/permission

Conversation

@lusu007
Copy link
Contributor

@lusu007 lusu007 commented Jan 22, 2026

Pull Request

Description

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • ♻️ Refactoring
  • 📚 Documentation
  • 🔧 Chore

Related Issues

None

Testing

  • Unit tests pass
  • Manual testing completed
  • New tests added for new functionality

Checklist

  • I have performed a self-review of my own code
  • Tests have been added/updated and pass (if needed)
  • Documentation has been updated (if needed)

@lusu007 lusu007 requested a review from ItsKev January 22, 2026 11:16
@lusu007 lusu007 self-assigned this Jan 22, 2026
@lusu007 lusu007 marked this pull request as ready for review January 26, 2026 15:15
Copilot AI review requested due to automatic review settings January 26, 2026 15:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new permissions subsystem (storage, gRPC admin/plugin endpoints, and change events) including expiry-driven refresh behavior.

Changes:

  • Introduces permissions/group persistence layer and Flyway migration (V2) for permissions tables.
  • Adds gRPC admin + plugin services/handlers plus event publishing/subscription for permission changes.
  • Adds scheduled expiry scanning and startup/subscription resume refresh emission, with unit tests.

Reviewed changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/resources/db/migration/V2__create_permissions.sql Creates DB tables for permission groups, group permissions, player groups, and player permissions.
src/main/resources/application.properties Enables new proto scan artifact and configures expiry scan interval (also changes log level).
build.gradle.kts Adds scheduler dependency and permission proto contracts dependency.
devspace.yaml Updates image repository/tag used for deployment/dev.
src/main/kotlin/gg/grounds/domain/permissions/ApplyOutcome.kt Defines apply outcomes used across repositories/handlers.
src/main/kotlin/gg/grounds/domain/permissions/PermissionGroup.kt Adds domain model for groups and permission grants.
src/main/kotlin/gg/grounds/domain/permissions/PlayerPermissionsData.kt Adds domain model for player permissions/groups and effective permissions.
src/main/kotlin/gg/grounds/persistence/permissions/BatchUpdateHelper.kt Adds helper to interpret JDBC batch update results.
src/main/kotlin/gg/grounds/persistence/permissions/PermissionsRepositoryException.kt Adds repository exception for “hard” query failures in group repo.
src/main/kotlin/gg/grounds/persistence/permissions/GroupRepository.kt Implements CRUD/list operations for permission groups and group permissions.
src/main/kotlin/gg/grounds/persistence/permissions/PlayerGroupRepository.kt Implements add/remove/query operations for player group memberships and expirations.
src/main/kotlin/gg/grounds/persistence/permissions/PlayerPermissionRepository.kt Implements add/remove/query operations for direct player permissions and expirations.
src/main/kotlin/gg/grounds/persistence/permissions/PermissionsQueryRepository.kt Implements permission read model (get permissions + check permission).
src/main/kotlin/gg/grounds/persistence/PlayerSessionRepository.kt Adds listActivePlayers() to support refresh-on-resume behavior.
src/main/kotlin/gg/grounds/api/permissions/ApplyResultMapper.kt Maps internal ApplyOutcome to proto ApplyResult.
src/main/kotlin/gg/grounds/api/permissions/PermissionsRequestParser.kt Centralizes parsing/sanitization for player IDs, grants, memberships, expiries.
src/main/kotlin/gg/grounds/api/permissions/PermissionsProtoMapper.kt Maps domain permissions models to gRPC reply protos.
src/main/kotlin/gg/grounds/api/permissions/PermissionsPluginGrpcService.kt Adds plugin-facing gRPC endpoints to fetch permissions and check permission.
src/main/kotlin/gg/grounds/api/permissions/PermissionsAdminGrpcService.kt Adds admin-facing gRPC endpoints for groups/permissions/player assignments.
src/main/kotlin/gg/grounds/api/permissions/admin/GroupAdminHandler.kt Implements admin group operations and emits deltas/refreshes when needed.
src/main/kotlin/gg/grounds/api/permissions/admin/PlayerGroupsAdminHandler.kt Implements admin player-group operations and emits player deltas.
src/main/kotlin/gg/grounds/api/permissions/admin/PlayerPermissionsAdminHandler.kt Implements admin player-permission operations and emits player deltas.
src/main/kotlin/gg/grounds/api/permissions/events/PermissionsEventsPublisher.kt Adds event publisher backing the gRPC streaming endpoint.
src/main/kotlin/gg/grounds/api/permissions/events/PermissionsChangeEmitter.kt Builds and publishes refresh/delta events for permission changes.
src/main/kotlin/gg/grounds/api/permissions/events/PermissionsChangeService.kt Wraps mutations to emit deltas if permissions changed.
src/main/kotlin/gg/grounds/api/permissions/events/PermissionsEventsGrpcService.kt Adds gRPC streaming endpoint for permission change events and resume refresh logic.
src/main/kotlin/gg/grounds/api/permissions/events/PermissionsExpiryScheduler.kt Adds periodic expiry scanning + startup refresh behavior.
src/main/kotlin/gg/grounds/api/PlayerPresenceGrpcService.kt Improves validation/logging for login/logout flows.
src/test/kotlin/gg/grounds/api/permissions/PermissionsPluginGrpcServiceTest.kt Adds tests for plugin permissions endpoints and validation/errors.
src/test/kotlin/gg/grounds/api/permissions/admin/GroupAdminHandlerTest.kt Adds tests for group admin handler behavior and validation.
src/test/kotlin/gg/grounds/api/permissions/admin/PlayerGroupsAdminHandlerTest.kt Adds tests for player-group admin handler behavior and validation.
src/test/kotlin/gg/grounds/api/permissions/admin/PlayerPermissionsAdminHandlerTest.kt Adds tests for player-permission admin handler behavior and validation.
src/test/kotlin/gg/grounds/api/permissions/events/PermissionsEventsGrpcServiceTest.kt Adds tests for subscription resume refresh behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments