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

Added a few more tests #14809

Merged
merged 6 commits into from
Jun 1, 2024
Merged

Added a few more tests #14809

merged 6 commits into from
Jun 1, 2024

Conversation

snipe
Copy link
Owner

@snipe snipe commented Jun 1, 2024

This PR reshuffles a few of the tests on users, adds a few more, and adds some translation strings. I also discovered a few missing checks (in the process of writing those tests) that I realized we weren't doing, which could potentially allow someone to delete a user that still managed other users, locations, etc. We prevent this on the front-end of course, but we weren't enforcing it on the back end.

Copy link

what-the-diff bot commented Jun 1, 2024

PR Summary

  • Enhanced User Searching and Filtering
    Changes were made in the UsersController.php file to improve user search functionality in our API. Users can now be searched and filtered based on their activation status and location. Also, there is an option to include deleted users within the search results if needed.

  • Restrictions on User Deletion
    We've made our system smarter by adding checks to prevent the deletion of a user under certain conditions. These conditions include if a user is trying to delete themselves, or if the target user is tied to assets, licenses, accessories, managed locations, or manages other users.

  • Improved Deletion Prompts
    Upgrades to the system now notify users about the reasons why a certain user cannot be deleted. These could be due to user being linked to assets, licenses, accessories, locations they manage or users under their control. Appropriate error messages have been framed and added to support this feature.

  • Enhanced Test Coverage for Deleting Users
    We’ve introduced two new test suites in both the API and web interfaces to validate our new restrictions on user deletion. These tests ensure that our system is working as expected in different user deletion scenarios.

@snipe snipe changed the title Features/more tests Added a few more tests Jun 1, 2024
@snipe snipe merged commit c4d97d0 into develop Jun 1, 2024
7 of 8 checks passed
@snipe snipe deleted the features/more_tests branch June 1, 2024 03:25
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.

1 participant