Skip to content

Added conditions on admin actions for sessions in sessions listing view#7

Merged
sgeulette merged 2 commits intomainfrom
SE-333/actions_available
Feb 4, 2026
Merged

Added conditions on admin actions for sessions in sessions listing view#7
sgeulette merged 2 commits intomainfrom
SE-333/actions_available

Conversation

@chris-adam
Copy link
Contributor

@chris-adam chris-adam commented Feb 4, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Session action buttons now respect user permissions and display conditionally
    • Delete button only appears for users with appropriate permissions
    • Create external session button only displays for authorized users when the session is in draft state

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

Added permission checks to action button rendering in the sessions table. Delete and Create External Session buttons now conditionally render based on permission checks via multi-adapter lookups, whereas previously they rendered unconditionally. Permission validation methods were added to the corresponding view classes.

Changes

Cohort / File(s) Summary
Permission Validation Methods
src/imio/esign/browser/views.py
Added may_delete_session() and may_create_external_sessions() permission check methods to SessionDeleteView and ExternalSessionCreateView respectively, each leveraging manage_session_perm permission logic.
Guarded Button Rendering
src/imio/esign/browser/table.py
Modified ActionsColumn to conditionally render Delete and Create External Session buttons based on multi-adapter permission checks via getMultiAdapter() lookups, replacing unconditional rendering.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Permission guards now stand tall and true,
Action buttons bow to what's allowed to do,
Delete and Create must ask "may I?" with care,
Security whispers through each layer, everywhere! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding conditional logic to admin action buttons in the sessions listing view, specifically guarding Delete and Create External Session actions with permission checks.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch SE-333/actions_available

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

@sgeulette sgeulette merged commit c8182b8 into main Feb 4, 2026
3 checks passed
@chris-adam chris-adam deleted the SE-333/actions_available branch February 5, 2026 08:28
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.

2 participants