Works perfect, thanks Anthony.
On Wednesday, May 28, 2014 11:10:37 AM UTC-4, Anthony wrote:
>
> You can include logic to set the readable and writable attributes of
> particular fields to True/False depending on Auth group membership. For
> example:
>
> db.define_table('mytable', Field('myfield', readable=False, writable=False
> ))
>
> if auth.has_membership('admin'):
> db.mytable.myfield.readable = db.mytable.myfield.writable = True
>
> I suppose you could write a decorator that does that, but it's not clear
> there would be any benefit over the simple approach above.
>
> Anthony
>
> On Wednesday, May 28, 2014 11:00:13 AM UTC-4, Tom Russell wrote:
>>
>> I have read through the docs but have not come across what I am trying to
>> do, if its possible.
>>
>> I have a table with 40 columns of data, I want to use a decorator or
>> similar to only allow some of them viewable while others in a different
>> membership group can see all of the columns.
>>
>> Is this something that can be done?
>>
>> Thanks,
>>
>> Tom
>>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.