Thanks. That brings some light. I was trying to fit it into a controller.
Regards
Johann
--
"Be not deceived; God is not mocked: for whatsoever a
man soweth, that shall he also reap."
Galatians 6:7
The example below would go in a model. It must be executed before
every action that accesses the db.comment table.
In your code the onaccept is set in an action therefore only valid
within the scope of the http request.
On Sep 7, 3:08 pm, Johann Spies wrote:
> Maybe I should rephrase my lack of u
Maybe I should rephrase my lack of understanding.
Can you explain the example from the book:
=
def give_create_permission(form):
group_id = auth.id_group('user_%s' % auth.user.id)
auth.add_permission(group_id, 'read', db.comment)
auth.add_permission(group_id, 'create',
Thanks for your answer. I am trying to understand.
On 7 September 2010 16:48, mdipierro wrote:
> It is a logic issue.
...
> You do not want to register the callback with "register_onaccept". you
> want to set these once for all:
>
> auth.add_permission(group_id, 'read', table)
> auth
It is a logic issue.
This line does nothing:
auth.settings.register_onaccept = (lambda
form,table=table:give_create_permission(form,table))
You do not want to register the callback with "register_onaccept". you
want to set these once for all:
auth.add_permission(group_id, 'read', table)
Is there anyone who can help me with this one please?
Regards
Johann
--
"Be not deceived; God is not mocked: for whatsoever a
man soweth, that shall he also reap."
Galatians 6:7
On 29 August 2010 07:05, mdipierro wrote:
> almost:
>
> def give_create_permission(form,table):
> group_id = auth.id_group('user_%s' % auth.user.id)
> auth.add_permission(group_id, 'read', table)
>
> and
>
> auth.settings.register_onaccept = (lambda form,
> table=table:give_create_pe
almost:
def give_create_permission(form,table):
group_id = auth.id_group('user_%s' % auth.user.id)
auth.add_permission(group_id, 'read', table)
and
auth.settings.register_onaccept = (lambda form,
table=table:give_create_permission(form,table))
On Aug 28, 3:22 pm, Johann Spies
8 matches
Mail list logo