Move connector privilege keys to their packages via a runtime registry#508
Merged
Conversation
yasithdev
approved these changes
Jun 30, 2026
yasithdev
left a comment
There was a problem hiding this comment.
This simplifies things a lot. LGTM! 👍🏽
|
@lahirujayathilake we should probably show the list of groups and the permissions they map to. |
Member
Author
Thanks for pointing that out @yasithdev, that's really a good to have list. I'll work on that and update this PR. |
ebf86cc to
f17b7cd
Compare
Member
Author
|
@yasithdev, included the privilege reference document |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Privilege keys now live where they belong.
coredeclares its own, connectors declare theirs. A small runtime registry inpkg/modelslets each package register its keys at startup, so core stays unaware of connector-specific privileges.AMIE specific privileges have been moved to its package.
Updated the privilege names to align with :: format
Main changes
pkg/models/privilege.go- the runtime registry:Register,IsKnownPrivilege,KnownPrivileges, core'sinit()self-registerconnectors/ACCESS/AMIE-Processor/server/privileges.go- first connector to declare + register its keys from its own packageOther - privilege renaming, tests updates
internal/server/,internal/store/,pkg/service/connectors/ACCESS/AMIE-Processor/server/handlers.go+handlers_test.goapi/core.openapi.yamldev-ops/compose/seeds/dev_users_and_roles.sql,connectors/ACCESS/AMIE-Processor/testdata/scenarios/baseline.yaml