Re: [web2py] Re: login_bare needs a password ?

2019-09-21 Thread Massimo Di Pierro

Can you logout and login again? The group membership is cached and maybe 
you changed after you tried the code.

On Wednesday, 18 September 2019 10:16:03 UTC-7, Ramos wrote:
>
> or maybe not
> I tried to impersonate other user that has membership PORTEIRO and i get 
> "Forbidden"
>
> Em qua, 18 de set de 2019 às 18:09, António Ramos  
> escreveu:
>
>> apparently i need to be logged in first. 
>>
>> solved!
>>
>> Em qua, 18 de set de 2019 às 17:38, António Ramos  
>> escreveu:
>>
>>> Is something like this??? It returns not authorized!
>>>
>>> auth.add_permission(db.auth_group(role="PORTEIRO")["id"],
>>> "impersonate",db.auth_user)
>>> auth.impersonate(4)# user 4 is included in the PORTEIRO group
>>>
>>> Em sex, 16 de ago de 2019 às 20:05, Dave S  
>>> escreveu:
>>>


 On Friday, August 16, 2019 at 11:22:33 AM UTC-7, Ramos wrote:
>
> hello the the login bare function
> auth.login_bare(user,pwd)
> needs a password !!
> Why ?
> I dont know the users passwords but need to impersonate some users to 
> create records on behalf of them 
>
> Am i reading it right ?
>
> Regards
> António
>

 Well, sure, it's a login method, right?

 What you need to look at is the impersonate method, which is described 
 in the long first section of
 >>> http://web2py.com/books/default/chapter/29/09/access-control#Authentication
 >

 (Speed-read:  click instead on
 >>> http://web2py.com/books/default/chapter/29/09/access-control#Restrictions-on-registration
  
 >
 and scroll up)


 /dps

 -- 
 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 web2py+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/73d3afa6-27b0-4a14-978a-82107713b3d6%40googlegroups.com
  
 
 .

>>>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/cab71625-398e-4ba4-ab17-46546720ff9d%40googlegroups.com.


Re: [web2py] Re: login_bare needs a password ?

2019-09-19 Thread António Ramos
any help?

Em qua, 18 de set de 2019 às 18:15, António Ramos 
escreveu:

> or maybe not
> I tried to impersonate other user that has membership PORTEIRO and i get
> "Forbidden"
>
> Em qua, 18 de set de 2019 às 18:09, António Ramos 
> escreveu:
>
>> apparently i need to be logged in first.
>>
>> solved!
>>
>> Em qua, 18 de set de 2019 às 17:38, António Ramos 
>> escreveu:
>>
>>> Is something like this??? It returns not authorized!
>>>
>>> auth.add_permission(db.auth_group(role="PORTEIRO")["id"],
>>> "impersonate",db.auth_user)
>>> auth.impersonate(4)# user 4 is included in the PORTEIRO group
>>>
>>> Em sex, 16 de ago de 2019 às 20:05, Dave S 
>>> escreveu:
>>>


 On Friday, August 16, 2019 at 11:22:33 AM UTC-7, Ramos wrote:
>
> hello the the login bare function
> auth.login_bare(user,pwd)
> needs a password !!
> Why ?
> I dont know the users passwords but need to impersonate some users to
> create records on behalf of them
>
> Am i reading it right ?
>
> Regards
> António
>

 Well, sure, it's a login method, right?

 What you need to look at is the impersonate method, which is described
 in the long first section of
 >>> http://web2py.com/books/default/chapter/29/09/access-control#Authentication
 >

 (Speed-read:  click instead on
 >>> http://web2py.com/books/default/chapter/29/09/access-control#Restrictions-on-registration
 >
 and scroll up)


 /dps

 --
 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 web2py+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/web2py/73d3afa6-27b0-4a14-978a-82107713b3d6%40googlegroups.com
 
 .

>>>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxOicBDSBz0ZZaDK9vbdqoo2jJbH8TbgYpJKLb5pgYGjDQ%40mail.gmail.com.


Re: [web2py] Re: login_bare needs a password ?

2019-09-18 Thread António Ramos
or maybe not
I tried to impersonate other user that has membership PORTEIRO and i get
"Forbidden"

Em qua, 18 de set de 2019 às 18:09, António Ramos 
escreveu:

> apparently i need to be logged in first.
>
> solved!
>
> Em qua, 18 de set de 2019 às 17:38, António Ramos 
> escreveu:
>
>> Is something like this??? It returns not authorized!
>>
>> auth.add_permission(db.auth_group(role="PORTEIRO")["id"],
>> "impersonate",db.auth_user)
>> auth.impersonate(4)# user 4 is included in the PORTEIRO group
>>
>> Em sex, 16 de ago de 2019 às 20:05, Dave S 
>> escreveu:
>>
>>>
>>>
>>> On Friday, August 16, 2019 at 11:22:33 AM UTC-7, Ramos wrote:

 hello the the login bare function
 auth.login_bare(user,pwd)
 needs a password !!
 Why ?
 I dont know the users passwords but need to impersonate some users to
 create records on behalf of them

 Am i reading it right ?

 Regards
 António

>>>
>>> Well, sure, it's a login method, right?
>>>
>>> What you need to look at is the impersonate method, which is described
>>> in the long first section of
>>> >> http://web2py.com/books/default/chapter/29/09/access-control#Authentication
>>> >
>>>
>>> (Speed-read:  click instead on
>>> >> http://web2py.com/books/default/chapter/29/09/access-control#Restrictions-on-registration
>>> >
>>> and scroll up)
>>>
>>>
>>> /dps
>>>
>>> --
>>> 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 web2py+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/73d3afa6-27b0-4a14-978a-82107713b3d6%40googlegroups.com
>>> 
>>> .
>>>
>>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxMM8WnMAWC7c5uQGi1RfiCNXHD8EFsYXZN_pJNEoDxMjg%40mail.gmail.com.


Re: [web2py] Re: login_bare needs a password ?

2019-09-18 Thread António Ramos
apparently i need to be logged in first.

solved!

Em qua, 18 de set de 2019 às 17:38, António Ramos 
escreveu:

> Is something like this??? It returns not authorized!
>
> auth.add_permission(db.auth_group(role="PORTEIRO")["id"],
> "impersonate",db.auth_user)
> auth.impersonate(4)# user 4 is included in the PORTEIRO group
>
> Em sex, 16 de ago de 2019 às 20:05, Dave S 
> escreveu:
>
>>
>>
>> On Friday, August 16, 2019 at 11:22:33 AM UTC-7, Ramos wrote:
>>>
>>> hello the the login bare function
>>> auth.login_bare(user,pwd)
>>> needs a password !!
>>> Why ?
>>> I dont know the users passwords but need to impersonate some users to
>>> create records on behalf of them
>>>
>>> Am i reading it right ?
>>>
>>> Regards
>>> António
>>>
>>
>> Well, sure, it's a login method, right?
>>
>> What you need to look at is the impersonate method, which is described in
>> the long first section of
>> > http://web2py.com/books/default/chapter/29/09/access-control#Authentication
>> >
>>
>> (Speed-read:  click instead on
>> > http://web2py.com/books/default/chapter/29/09/access-control#Restrictions-on-registration
>> >
>> and scroll up)
>>
>>
>> /dps
>>
>> --
>> 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 web2py+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/73d3afa6-27b0-4a14-978a-82107713b3d6%40googlegroups.com
>> 
>> .
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxPzMxMbArXtP%2B1oqemtHTAe5WctUeQ-Fu1SOSpEwxp52w%40mail.gmail.com.


Re: [web2py] Re: login_bare needs a password ?

2019-09-18 Thread António Ramos
Is something like this??? It returns not authorized!

auth.add_permission(db.auth_group(role="PORTEIRO")["id"],
"impersonate",db.auth_user)
auth.impersonate(4)# user 4 is included in the PORTEIRO group

Em sex, 16 de ago de 2019 às 20:05, Dave S  escreveu:

>
>
> On Friday, August 16, 2019 at 11:22:33 AM UTC-7, Ramos wrote:
>>
>> hello the the login bare function
>> auth.login_bare(user,pwd)
>> needs a password !!
>> Why ?
>> I dont know the users passwords but need to impersonate some users to
>> create records on behalf of them
>>
>> Am i reading it right ?
>>
>> Regards
>> António
>>
>
> Well, sure, it's a login method, right?
>
> What you need to look at is the impersonate method, which is described in
> the long first section of
>  http://web2py.com/books/default/chapter/29/09/access-control#Authentication
> >
>
> (Speed-read:  click instead on
>  http://web2py.com/books/default/chapter/29/09/access-control#Restrictions-on-registration
> >
> and scroll up)
>
>
> /dps
>
> --
> 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 web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/73d3afa6-27b0-4a14-978a-82107713b3d6%40googlegroups.com
> 
> .
>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxMVNyfTzUzMrJ9%3DSDYatam7dKF5d61ZB3-KvsX3%3D9h5Ng%40mail.gmail.com.