akveo / ngx-admin-bundle-support

Support repository for ngx-admin backend bundles with issues tracking, instructions and code samples
58 stars 32 forks source link

Profile editor wipes out a user's role #8

Closed daveboulden closed 4 years ago

daveboulden commented 4 years ago

Currently, if you use the profile editor (/app/pages/users/user/user.component) to update a user's information, the process wipes out the user's role so that they can no longer login with their previous permission when logging in next time. Fields not included in the profile editor form need to be preserved.

Database entry for user before profile edit:

{
  "_id": "5d3076de10ec814ba0f2a898",
  "email": "john@smith.co.uk",
  "fullName": "John Smith",
  "salt": "5e375ced8b54b388",
  "passwordHash": "406983938... <snip> ...2cc52b5bf",
  "role": "admin",      <--------------------------------------------
  "address": {
    "street": "8 The Street",
    "city": "Townsville",
    "zipCode": "TO10 1AB"
  },
  "age": "25",
  "firstName": "John",
  "lastName": "Smith",
  "login": null
}

Database entry after profile edit:

{
  "_id": "5d3076de10ec814ba0f2a898",
  "email": "john@smith.co.uk",
  "fullName": "John Smith",
  "salt": "5e375ced8b54b388",
  "passwordHash": "406983938... <snip> ...2cc52b5bf",
  "role": null,        <------------------------------------------
  "address": {
    "street": "12 Letsbe Avenue",
    "city": "Cityville",
    "zipCode": "CV13 4CD"
  },
  "age": "25",
  "firstName": "John",
  "lastName": "Smith",
  "login": null
}
valentinkononov commented 4 years ago

Hi Dave, thanks for letting me know this! We will fix that and push the update in the nearest days

valentinkononov commented 4 years ago

fixed, available in the latest updated of the bundle archive