[4.1][webservices] post user fix editable on frontend only #37030
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue #36936 .
Summary of Changes
if editable only on frontend allow the post from the webservices like from admin
Testing Instructions
Set a User->Field (Phone as an example) to 'Required'="yes", AND 'Editable In'="Site"
Create a user with REST API:
POST: {{base_url}}/{{base_path}}/users
BODY:
{"block":"0","email":"bob.smith@test.com","groups":["2"],"lastResetTime":"","lastvisitDate":"","name":"Bob Smith","params":{"admin_language":"","admin_style":"","editor":"","helpsite":"","language":"","timezone":""},"password":"qwerty1235%%##","password2":"qwerty1235%%##","registerDate":"","requireReset":"0","resetCount":"0","sendEmail":"0","username":"bobsmith"}
Actual result BEFORE applying this Pull Request
error
"title": "Invalid field: phone"
Expected result AFTER applying this Pull Request
able to create user