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
What is quite neat in my opinion is the following snippet from the Statamic\Http\Controllers\CP\Users\UsersController@edit (with also code going along in the update method of course):
$blueprint = $user->blueprint();
if (! User::current()->can('edit roles')) {
$blueprint->ensureField('roles', ['read_only' => true]);
}
if (! User::current()->can('edit user groups')) {
$blueprint->ensureField('groups', ['read_only' => true]);
}
Would it be possible to add an event to the edit and update method of the controller, so we can add extra fields that may be read-only for some users, and editable for others in the same way?
The text was updated successfully, but these errors were encountered:
What is quite neat in my opinion is the following snippet from the
Statamic\Http\Controllers\CP\Users\UsersController@edit
(with also code going along in the update method of course):Would it be possible to add an event to the
edit
andupdate
method of the controller, so we can add extra fields that may be read-only for some users, and editable for others in the same way?The text was updated successfully, but these errors were encountered: