Closed allynt closed 4 years ago
Currently, the default UserRoleSerializer is used when serializing users. This produces a list of objects:
UserRoleSerializer
"roles": [ { "id": 1, "name": "ManagerRole", "description": "", "permissions": [ { "id": 1, "name": "can_do_important_stuff", "description": "" } ] } ]
This is probably overkill for the frontend.
Instead I should just output a list of the role & permission names:
"roles": [ "ManagerRole"], "permissions": ["name": "can_do_important_stuff"],
These will probably be SerializerMethodField.
SerializerMethodField
Note that this means that updating a User's roles will be done via another endpoint.
fixed by #13
Is your feature request related to a problem? Please describe
Currently, the default
UserRoleSerializer
is used when serializing users. This produces a list of objects:This is probably overkill for the frontend.
Describe the solution you'd like
Instead I should just output a list of the role & permission names:
These will probably be
SerializerMethodField
.Additional context
Note that this means that updating a User's roles will be done via another endpoint.