Skip to content

Add roles management screens (list and edit roles) - #675

Merged
tungleduyxyz merged 5 commits into
masterfrom
feature/role-management
Oct 29, 2026
Merged

tungleduyxyz merged 5 commits into
masterfrom
feature/role-management

Conversation

@tungleduyxyz

Copy link
Copy Markdown
Contributor

Summary

  • Add a Roles page listing role definitions, using Kill Bill's GET /1.0/kb/security/roles (Kill Bill 0.25+). On older servers the page shows "Listing roles requires Kill Bill 0.25 or later."
  • Add edit and update of a role's permissions, reusing the role form (role name read-only, "Update Role" button)
  • Add Roles links in the settings sidebar, the navbar menu and the home dashboard
  • An unknown role opens a "was not found" message instead of an empty form (Kill Bill answers 200 with no permissions for unknown roles)

Fixes #161

Depends on

Testing

  • rails t test/functional/kaui/role_definitions_controller_test.rb: 9 runs, 44 assertions, 0 failures, against Kill Bill 0.25.4 on Tomcat 11 (client from the local checkout of the PR above)
  • In the browser against Kill Bill 0.25.4: created a role, saw it listed, edited its permissions and saved; the list showed the update
  • On Kill Bill 0.24.16: edit and update work, the list shows the 0.25+ message
  • The functional test setup needs Kill Bill's bus polling lowered (-Dorg.killbill.persistent.bus.main.sleep=100 -Dorg.killbill.persistent.bus.external.sleep=100 -Dorg.killbill.notificationq.main.sleep=100), otherwise callCompletion requests return 408

Notes

- Add Roles list page (GET /role_definitions) backed by Kill Bill's
  GET /1.0/kb/security/roles (Kill Bill 0.25+); show a message on older servers
- Add edit/update of a role's permissions, reusing the role form
- Add Roles links in the settings sidebar, navbar menu and home dashboard
- Add controller tests

Fixes #161
The roles table is now filled through a role_definitions/pagination JSON
endpoint, like the Tags tab: the server filters by role name or permission
and returns only the requested page. The search box sits next to the Create
Role button and reuses the Tags search and pagination styling.
tungleduyxyz and others added 3 commits October 28, 2026 22:26
…ribute

Avoids printing the user-provided query as raw JSON inside the page script
(CodeQL rb/reflected-xss).
…killbill-client

CI and installs use the released killbill-client gem (4.0.9), which has no
find_all, so the roles list and its tests failed with NameError. Fall back to
the client's own implementation when a newer client provides it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tungleduyxyz
tungleduyxyz merged commit 9cc7dda into master Oct 29, 2026
13 checks passed
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.

Roles management screens

2 participants