I am sorry, I cannot figure out exactly what you are doing but I see a
possible problem. You cannot use @auth.requires_signature() and
SQLFORM.grid(user_signature=True) at the same time because the grid would
use its own URL signature and that is not the same expected by the
decorator.
On Thursday, 24 December 2015 05:04:11 UTC-6, Jes M wrote:
>
> Hi:
>
> I've been browsing google but I can't manage the code to works with other
> solutions I've found. Here it goes the issue:
>
> controller:
>
> btn_edit = lambda row: A(T("Editar"), _href=URL('manage_user', args=[
> row.id],user_signature=True))
> links = [ btn_edit ]
> ......
> ......
> adminusers_grid = SQLFORM.grid(query = adminusers_query,
> fields = fields,
> links = links,
> field_id = db.auth_user.id,
> orderby = (db.auth_user.last_name),
> create=False,
> deletable=False,
> editable=False,
> details=False,
> searchable=True,
> showbuttontext=False,
> user_signature=True,
> csv=False,
> formstyle="div",
> args=request.args[:1],
> paginate=10
> )
> ....
> ....
>
> @auth.requires_signature()
> @auth.requires_membership("admin")
> def manage_user():
> user_id = request.args(0) or
> redirect(URL('useradministration',user_signature=True))
> ...
> ...
>
>
>
> I always get "Not Authozied" when I click in the URL passed as link to the
> SQLFORM.grid. I've tested:
>
> with and without "args=request.args[:1]," (same behaviour)
> with and without "hash_vars=True" in @auth.requires_signature() (same
> result, not authorized)
>
>
> But if I build the URL without args, for example:
>
> btn_edit = lambda row: A(T("Editar"), _href=URL('manage_user',
> user_signature=True))
>
> Then the URL works and it goes to 'manage_user'.
>
> I can't figure out how to modify the code in order I can pass an argument
> to manage_user() usign digital signatures.
>
> Any idea?
>
> Thanks in advance,
>
> Jes
>
--
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.