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

Fixed userResource request to get all users #18105

Open
wants to merge 1 commit into
base: v13/dev
Choose a base branch
from

Conversation

AndyButland
Copy link
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

Fixes: #12471

Description

This PR fixes the request usersResource.getUsers that you can issue from the backoffice in angularjs. It's not actually used in the backoffice code, but could be used in packages or custom backoffice extensions.

There were two issues:

  • The model binding of the request wasn't correct. I've aligned it with similar GetByIds requests in other controllers so it works now.
  • The authentication wasn't correctly checking the querystring value for ensuring that only admin users can retrieve admin user details.

To Test:

  • Throw the following code in somewhere where you have or have added an injected userResource:
      usersResource.getUsers([-1]).then(function (data) {
        console.log(data);
      })
  • Check that it works correctly for an admin user but doesn't for a non-admin one.

@AndyButland AndyButland changed the title Fixed userResource request to get all users. Fixed userResource request to get all users Jan 24, 2025
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