Skip to content

Add helper method to determine if user has admin rights#291

Merged
PGijsbers merged 1 commit intomainfrom
is_admin
Mar 25, 2026
Merged

Add helper method to determine if user has admin rights#291
PGijsbers merged 1 commit intomainfrom
is_admin

Conversation

@PGijsbers
Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 382148fa-7e83-49ce-993e-9731edcfbaeb

📥 Commits

Reviewing files that changed from the base of the PR and between f77c4a8 and 06fc7bd.

📒 Files selected for processing (5)
  • src/core/access.py
  • src/database/users.py
  • src/routers/openml/datasets.py
  • src/routers/openml/setups.py
  • src/routers/openml/study.py

Walkthrough

The pull request refactors admin-access checks across the codebase. A new is_admin() method is added to the User class in src/database/users.py. Multiple files in src/core/ and src/routers/openml/ are updated to use await user.is_admin() instead of the prior pattern of checking UserGroup.ADMIN membership via await user.get_groups(). The UserGroup import is removed from affected files.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to evaluate whether it relates to the changeset. Add a pull request description explaining the purpose of the new is_admin() method and why it replaces the previous group membership checks.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a new is_admin() helper method to the User class for determining admin rights.

✏️ 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 is_admin

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.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 38.46154% with 8 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@f77c4a8). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/routers/openml/datasets.py 25.00% 3 Missing ⚠️
src/routers/openml/study.py 33.33% 2 Missing ⚠️
src/core/access.py 50.00% 1 Missing ⚠️
src/database/users.py 50.00% 1 Missing ⚠️
src/routers/openml/setups.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #291   +/-   ##
=======================================
  Coverage        ?   54.15%           
=======================================
  Files           ?       37           
  Lines           ?     1553           
  Branches        ?      135           
=======================================
  Hits            ?      841           
  Misses          ?      710           
  Partials        ?        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PGijsbers PGijsbers merged commit 3e961e9 into main Mar 25, 2026
9 checks passed
@PGijsbers PGijsbers deleted the is_admin branch March 25, 2026 15:08
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