Hi--
lördag 19 december 2020 kl. 20:16:52 CET skrev Muhammad Saleh:
> Hey guys I tried adding an additional roles to an authenticated user but it
> is giving me error "invalid request options"
This is impossible to answer without more in-depth information about which
role you were trying to add, and how you attempted to do that, which code
version you are using etc.
I've been adding/removing user roles many times in recent days, and never seen
that error - and it is difficult to see from the code how that would at all be
possible, as it would mean that the JSON library of your browser produces
invalid JSON, which is somewhat inconceivable.
So I'm afraid you need to help us here to reproduce the error before we can
tell what causes it, and perhaps fix it.
> , and i can only disable users
> not delete them.
That is correct - you cannot delete users because they are almost always
referenced as owners and/or authors/editors of other records, so you can only
ever disable them...which is a deliberate design choice, though, i.e. it's an
integrity feature, not a bug.
However, after disabling them, you can anonymize their accounts in order to
remove their data - if your template provides an anonymizer configuration.
An example configuration of the anonymizer that includes user accounts can be
found here:
https://github.com/sahana/eden/blob/master/modules/templates/RLP/anonymize.py
Most standard templates will not have that, though - so you will probably have
to make do with just disabling the account.
Dominic