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

Refactor group syncing on user edit API endpoint #14745

Merged
merged 11 commits into from
May 22, 2024
Merged

Conversation

snipe
Copy link
Owner

@snipe snipe commented May 21, 2024

This tightens up the code around syncing user group membership when using the API and adds a bunch of tests for conditions we weren't testing before.

Copy link

what-the-diff bot commented May 21, 2024

PR Summary

  • Improved User Permission Handling
    The file app/Http/Controllers/Api/UsersController.php is now more robust with added clarifications for user permissions processing. We've also enhanced the conditions for user group assignments to account for superusers.
  • User Interface Text Changes
    In resources/views/groups/view.blade.php, we've updated the text to offer a clearer user interface.
  • Added Test Cases for User Management
    In tests/Feature/Api/Users/UpdateUserApiTest.php, we've added new test scenarios to comprehensively check non-superuser cases as well as superuser group assignments. This will make sure our user management functionality is more accurate and reliable.

Copy link
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

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

Looks good! There's a small variable typo but other than that :shipit:

tests/Feature/Api/Users/UpdateUserApiTest.php Outdated Show resolved Hide resolved
tests/Feature/Api/Users/UpdateUserApiTest.php Outdated Show resolved Hide resolved
tests/Feature/Api/Users/UpdateUserApiTest.php Outdated Show resolved Hide resolved
tests/Feature/Api/Users/UpdateUserApiTest.php Outdated Show resolved Hide resolved
tests/Feature/Api/Users/UpdateUserApiTest.php Outdated Show resolved Hide resolved
snipe added 2 commits May 22, 2024 12:34
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
@snipe snipe requested a review from uberbrady May 22, 2024 11:35
Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

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

This looks great! Nice cleanups here.

@snipe snipe merged commit c9f7847 into develop May 22, 2024
9 checks passed
@snipe snipe deleted the fixes/self_api_endpoint branch May 22, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants