Skip to content

Add InpatientClinicalDischarge to privilege tree; document 3-step privilege process#19678

Merged
buddhika75 merged 1 commit intodevelopmentfrom
19677-add-inpatient-clinical-discharge-privilege-to-tree
Apr 3, 2026
Merged

Add InpatientClinicalDischarge to privilege tree; document 3-step privilege process#19678
buddhika75 merged 1 commit intodevelopmentfrom
19677-add-inpatient-clinical-discharge-privilege-to-tree

Conversation

@buddhika75
Copy link
Copy Markdown
Member

@buddhika75 buddhika75 commented Apr 3, 2026

Summary

  • Register InpatientClinicalDischarge as a DefaultTreeNode under the Clinical branch of the Inward section in UserPrivilageController.java — it was missing, so administrators had no way to grant this privilege through the UI
  • Update developer_docs/security/privilege-system.md with an explicit 3-step checklist and a warning that adding the enum value alone is NOT sufficient (introduced after this was missed in PR Implement three-tier discharge system: clinical, room, and hospital discharge #19658)
  • Update CLAUDE.md with a When Adding a New Privilege section pointing to the guide

Root Cause (PR #19658)

The InpatientClinicalDischarge privilege was added to Privileges.java in PR #19658 but the matching DefaultTreeNode registration in UserPrivilageController.java was omitted, making the privilege invisible in /admin/users/user_privileges.xhtml.

Test plan

  • Log in as admin and navigate to /admin/users/user_privileges.xhtml
  • Select a user and click List Privileges
  • Expand Inward → Clinical — verify Clinical Discharge now appears
  • Grant the privilege to a test user and confirm inward_clinical_discharge.xhtml becomes accessible
  • Confirm the privilege is denied when not granted

Closes #19677

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added "Clinical Discharge" privilege option to the admin privilege management system.
  • Documentation

    • Enhanced privilege integration documentation with comprehensive guidelines for configuring new privileges in the system.

…process

The InpatientClinicalDischarge privilege was added to Privileges.java in
PR #19658 but was not registered in UserPrivilageController.java, making
it invisible in the admin privilege management UI. Administrators had no
way to grant this privilege through the UI.

Changes:
- Register InpatientClinicalDischarge as a DefaultTreeNode under the
  "Clinical" branch of the Inward section in UserPrivilageController.java
- Update developer_docs/security/privilege-system.md with an explicit
  3-step checklist and warning that enum-only addition is not sufficient
- Update CLAUDE.md with a "When Adding a New Privilege" section linking
  to the privilege system guide

Closes #19677

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 50756c44-e9d5-4e50-b461-3a0bae079292

📥 Commits

Reviewing files that changed from the base of the PR and between a0c7e19 and e60de5e.

📒 Files selected for processing (3)
  • CLAUDE.md
  • developer_docs/security/privilege-system.md
  • src/main/java/com/divudi/bean/common/UserPrivilageController.java

Walkthrough

This pull request addresses a missing privilege registration and improves developer documentation. The InpatientClinicalDischarge privilege, previously added to the enum, is now registered in UserPrivilageController to appear in the privilege management UI. Additionally, documentation is updated to clarify the three-step process required when adding new privileges.

Changes

Cohort / File(s) Summary
Documentation & Guide Updates
CLAUDE.md, developer_docs/security/privilege-system.md
Added guidance section on the 3-step privilege-addition process with checklist. Expanded privilege-system.md to detail: adding getCategory() case mapping, registering tree nodes in UserPrivilageController, and guarding UI with XHTML rendered attributes. Emphasizes that enum addition alone is insufficient.
Privilege Tree Registration
src/main/java/com/divudi/bean/common/UserPrivilageController.java
Registered InpatientClinicalDischarge privilege as a DefaultTreeNode under the inward clinical section, making it selectable in the privilege management UI.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes both main objectives: adding InpatientClinicalDischarge to the privilege tree and documenting the 3-step privilege process.
Linked Issues check ✅ Passed The PR fully addresses issue #19677: it registers InpatientClinicalDischarge in UserPrivilageController.java, documents the 3-step privilege process, and updates developer documentation.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue #19677: updating the privilege tree, documenting the process, and adding developer guidance.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 19677-add-inpatient-clinical-discharge-privilege-to-tree

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@buddhika75 buddhika75 merged commit f7393bc into development Apr 3, 2026
3 checks passed
@buddhika75 buddhika75 deleted the 19677-add-inpatient-clinical-discharge-privilege-to-tree branch April 3, 2026 00:32
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.

InpatientClinicalDischarge privilege missing from user_privileges page (UserPrivilageController tree)

1 participant