Hi!!
I'm trying to solve two problems with Mapper.
1) My user class (a mapper) has a field "passwordHash". This field should not be exposed using the encodeAsJSON function. Is there an easy way to exclude/filter fields for this function?
2) I have a field "dateCreated" which is only written once when the object is stored in the database. Afterwards, this field should only be read and must not be written. Again, is there an easy way to achieve this? For example I'm using decodeFromJSON so this function should either ignore the field or throw an error.
An optimal solution would be to only touch the mapped fields and not the encode/decodeFromJSON functions but I don't know if this is possible.
In the documentation and in the code, I've seen some things like "readPermission" or "writePermission" but I have no idea how they work.
Thanks in advance,
Julian
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
1) Prevent mapped fields from being exposed by encodeAsJson_!
2) Prevent mapped fields from beeing written from outside (for example a
"created" date field which is only written once when the object is
stored the first time in the database).
dpp asked me to open a ticket containing both wishes:
https://liftweb.assembla.com/spaces/liftweb/tickets/477-improvements-to-mapper-to-exclude-fields-from-encodeasjson
As far as I can judge, the first point seems to be implemented but what
about the second point?
Julian
Am 16.04.10 20:17, schrieb David Pollak:
>
>
> <mailto:lif...@googlegroups.com>.
> To unsubscribe from this group, send email to
> liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
First of all, I'm sorry to revive this old thread.
Two months ago, I asked for two changes concerning Mapper:
1) Prevent mapped fields from being exposed by encodeAsJson_!
2) Prevent mapped fields from beeing written from outside (for example a "created" date field which is only written once when the object is stored the first time in the database).
dpp asked me to open a ticket containing both wishes:
https://liftweb.assembla.com/spaces/liftweb/tickets/477-improvements-to-mapper-to-exclude-fields-from-encodeasjson
As far as I can judge, the first point seems to be implemented but what about the second point?