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
When a user edits their own profile, changes to full name, email, organization, and role are silently discarded and never reach the database.
In UserObjectTranslator.java, self-edits take a different path than when editing another account.
@Override
public void filterExternalObject(UserContext userContext,
User existingObject, APIUser object) throws GuacamoleException {
// If a user is editing themselves ...
if (existingObject != null && existingObject.getIdentifier().equals(userContext.self().getIdentifier())) {
// ... they may only edit preference attributes
object.setAttributes(filterAttributes(userContext.getUserPreferenceAttributes(),
object.getAttributes()));
}
else {
// In all other cases, filter object attributes by defined schema
object.setAttributes(filterAttributes(userContext.getUserAttributes(),
object.getAttributes()));
}
}
Self-edits are filtered by UserObjectTranslator.filterExternalObject() using getUserPreferenceAttributes(). For ModeledUserContext, that currently returns no allowed fields, so filterAttributes() strips all profile attributes before the update is processed. The fix is to have ModeledUserContext expose the standard profile fields as user-editable preferences.
@bbennett-ks Is there any mechanism for this access being limited? Is it tied to the "Change own password" permission, or is it just assumed that users should always be able to edit their own attributes?
@bbennett-ks Is there any mechanism for this access being limited? Is it tied to the "Change own password" permission, or is it just assumed that users should always be able to edit their own attributes?
It's a little odd... First, a non-admin user needs Create new users permission to be able to access User settings screen. And then you need Change password permission to be able to open the User settings screen. If not, you get Sorry, but this user account cannot be edited.
Maybe, one should be able to change Profile via the Preferences screen, like one can change the password (if Change passwd permission is enabled).
@necouchman Let me know if you'd like the profile data to be Preferences screen unconditionally. Seems like the best design choice,..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
When a user edits their own profile, changes to full name, email, organization, and role are silently discarded and never reach the database.
In
UserObjectTranslator.java, self-edits take a different path than when editing another account.Self-edits are filtered by
UserObjectTranslator.filterExternalObject()usinggetUserPreferenceAttributes(). ForModeledUserContext, that currently returns no allowed fields, sofilterAttributes()strips all profile attributes before the update is processed. The fix is to haveModeledUserContextexpose the standard profile fields as user-editable preferences.