-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User Zero / Super Admin #1021
base: main
Are you sure you want to change the base?
User Zero / Super Admin #1021
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR introduces user-0 functionality and super admin capabilities to improve system job attribution and access control management.
- Added system user (ID 0) with restricted permissions for handling system operations like error emails and control workload measurements
- Introduced
is_super_admin()
capability check inlib/user.py
for controlling data access across users - Modified database schema to enforce
user_id NOT NULL
constraints in jobs/runs tables with proper foreign key relationships - Added migration script to create user-0 and update existing records with appropriate user associations
- Changed default user ID from
None
to1
across the codebase for proper user attribution
💡 (4/5) You can add custom instructions or style guidelines for the bot here!
7 file(s) reviewed, 9 comment(s)
Edit PR Review Bot Settings | Greptile
* main: (fix): tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
8 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
Eco-CI Output:
🌳 CO2 Data: |
Added user-0 functionality and super_admin functionality
TBD:
Greptile Summary
Implements user-0 system account and super admin functionality, adding proper user attribution and access control for system operations and cross-user data access.
is_super_admin()
method in/lib/user.py
to check admin capabilities/docker/structure.sql
with restricted permissions for system operations/migrations/2024_12_17_user_zero.sql
to create user-0 and update existing recordsuser_id NOT NULL
constraints withON DELETE RESTRICT
💡 (4/5) You can add custom instructions or style guidelines for the bot here!