You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because no scenario is defined on the User model before loading data.
And with no scenario, the status property is no returned User::safeAttributes().
So we need to set the scenario to User::SCENARIO_EDIT_ADMIN.
Problem: authclient and authclient_id are still not safe attributes with User::SCENARIO_EDIT_ADMIN.
Solution 1: in User::scenarios(), add 'authclient', 'authclient_id' to $scenarios[self::SCENARIO_EDIT_ADMIN]
Solution 2: create a new one such as User::SCENARIO_REST_API_EDIT_ADMIN.
And in User::scenarios() we could add:
Steps to reproduce:
Create a new user using https://marketplace.humhub.com/module/rest/docs/html/user.html#tag/User/paths/~1user/post
In the POST data, set the
status
to2
:The new user has status
1
.This is because no scenario is defined on the
User
model before loading data.And with no scenario, the
status
property is no returnedUser::safeAttributes()
.So we need to set the scenario to
User::SCENARIO_EDIT_ADMIN
.Problem:
authclient
andauthclient_id
are still not safe attributes withUser::SCENARIO_EDIT_ADMIN
.Solution 1: in
User::scenarios()
, add'authclient', 'authclient_id'
to$scenarios[self::SCENARIO_EDIT_ADMIN]
Solution 2: create a new one such as
User::SCENARIO_REST_API_EDIT_ADMIN
.And in
User::scenarios()
we could add:The text was updated successfully, but these errors were encountered: