Skip to content
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

Refactoring user model and associated permission interface #566

Merged
merged 6 commits into from
Nov 27, 2024

Conversation

terjekv
Copy link
Collaborator

@terjekv terjekv commented Nov 26, 2024

Migrate user-related permissions to the User model, instead of using functions in permissions.py that take user objects or requests as parameters. This is a building block towards cleaning up the permissions interface in general, attempting to make it more readable and extendable.

@terjekv terjekv self-assigned this Nov 26, 2024
@coveralls
Copy link
Collaborator

coveralls commented Nov 26, 2024

Coverage Status

coverage: 98.3% (-0.07%) from 98.372%
when pulling b15c242 on refactor_user_permission_model
into 2e0a77d on master.

mreg/models/auth.py Outdated Show resolved Hide resolved
  - Rename `is_mreg_group_admin` to `is_mreg_hostgroup_admin` as its much more precise. We should consider renaming the JSON output as well but that would require modifying the CLI.
  - Restrict whois to supers, admins, and hostgroup admins. Network admins shouln't have to manage user access checking.
  -  Add documenation to the User model.
  - Also fixed the settings tests with excellent help from @ponas. Thanks!
@terjekv terjekv marked this pull request as ready for review November 26, 2024 11:20
@terjekv terjekv requested a review from pederhan November 26, 2024 11:20
@terjekv terjekv changed the title Refactoring tests for user permissions. Refactoring user model and associated permission interface Nov 26, 2024
Copy link
Member

@pederhan pederhan left a comment

Choose a reason for hiding this comment

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

LGTM!

@terjekv terjekv merged commit 1b7126c into master Nov 27, 2024
29 checks passed
@oyvindhagberg oyvindhagberg deleted the refactor_user_permission_model branch December 4, 2024 10:07
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.

4 participants