[web2py] Re: Auth question

2018-10-30 Thread fjbernal2020
Hi, I think the easier way is here http://web2py.com/books/default/chapter/29/09/access-control > ## after auth = Auth(db) > > > db.define_table('workspaces', > > Field('workspace', 'string', requires=IS_NOT_EMPTY())) > > auth.settings.extra_fields['auth_user']= [ > Field('workspace

Re: [web2py] Re: Auth question

2018-10-28 Thread Rahul
Hi Jim, This works like a charm. Thank you for this. It is what I expected and wanted to achieve with Auth. I'll check my new project for what I may be doing wrong, for now it seems that the scaffolding admin interface I want to use for my app is the one that is the culprit. It has lots

Re: [web2py] Re: Auth question

2018-10-27 Thread Jim Steil
Rahul Let's try this a different way. Attached is a simple multi-tenant app with one table. Does this do what you need? 1. Create a new project in web2py 2. Replace db.py in your models dir with this one 3. Replace default.py in your controllers dir with this one 4. Replace index.html in vi

Re: [web2py] Re: Auth question

2018-10-27 Thread Rahul
Hi Dave and Jim, Please find the files in the zipped archive. I have added default.py, db.py, index.html and also layout file which I am converting to use with web2py. called ace.html. I have also attached the views\login.html file since I am extending this file specifically for logi

Re: [web2py] Re: Auth question

2018-10-26 Thread Jim Steil
Can you show the entire db.py, default py and index.html? Jim On Fri, Oct 26, 2018, 1:44 AM Rahul wrote: > Nope - doesnt help. I commented out all the user functions defined in the > controller and > > > # User functions --- > '''def login(): return dict(form=auth.login()) > def register(

Re: [web2py] Re: Auth question

2018-10-26 Thread Dave S
On Thursday, October 25, 2018 at 11:44:18 PM UTC-7, Rahul wrote: [...] > I even decorated index - It does take me to the login screen but from > there nothing happens. It just wont log me in like it did before. Also, I > have two users in database but none work now. Again, register seems to

Re: [web2py] Re: Auth question

2018-10-25 Thread Rahul
Nope - doesnt help. I commented out all the user functions defined in the controller and # User functions --- '''def login(): return dict(form=auth.login()) def register(): return dict(form=auth.register()) def retrieve_password(): return dict(form=auth.reset_password()) def logout(): retu

Re: [web2py] Re: Auth question

2018-10-25 Thread Jim S
Having the default user() functions is all you need. I'd try commenting out your 'user' functions. -Jim On Wednesday, October 24, 2018 at 10:59:45 PM UTC-5, Rahul wrote: > > Yes this is in default.py. Please excuse me for my bad code as I am still > experimenting with Auth and not totally fami

Re: [web2py] Re: Auth question

2018-10-24 Thread Rahul
Yes this is in default.py. Please excuse me for my bad code as I am still experimenting with Auth and not totally familiar with the implementation. Is this the right way that I am doing it? or only having user() function is enough ? Thanks, Rahul On Wednesday, October 24, 2018 at 9:45:21 PM U

Re: [web2py] Re: Auth question

2018-10-24 Thread Jim S
I'm confused. Is this code in your controller somewhere? # User functions --- def login(): return dict(form=auth.login()) def register(): return dict(form=auth.register()) def retrieve_password(): return dict(form=auth.reset_password()) def logout(): return dict(form=auth.logout()) def profi

Re: [web2py] Re: Auth question

2018-10-23 Thread Rahul
The user function remains as-is - No modifications done. def user(): """ exposes: http:///[app]/default/user/login http:///[app]/default/user/logout http:///[app]/default/user/register http:///[app]/default/user/profile http:///[app]/default/user/re

Re: [web2py] Re: Auth question

2018-10-23 Thread Jim S
Did you modify the user() function in default.py? Or, are you using your own custom login functions? -Jim On Tuesday, October 23, 2018 at 7:59:21 AM UTC-5, Rahul wrote: > > Hi Jim, All, > Okay I tried this - And I also decorated index() function in > controller like below as I want to

Re: [web2py] Re: Auth question

2018-10-23 Thread Rahul
Hi Jim, All, Okay I tried this - And I also decorated index() function in controller like below as I want to redirect the user to login page rather than directly jumping to index.html # example index page @auth.requires_login() def index(): response.flash= T("Hello World"

Re: [web2py] Re: Auth question

2018-10-18 Thread Rahul
Hi Jim, That makes sense. I will check it out on which option to go. Thanks! for all the guidance. Thank you, *Rahul Dhakate* On Wednesday, October 17, 2018 at 7:57:32 PM UTC+5:30, Jim S wrote: > > Rahul > > First, what I was referring to was common_filters, not common fields. > Here

Re: [web2py] Re: Auth question

2018-10-17 Thread Jim Steil
Rahul First, what I was referring to was common_filters, not common fields. Here is the scenario as I see it. In you auth_user table you have a workspace field. Then in other tables that are workspace-specific you also have a workspace field to show which workspace they relate to Here is how I

[web2py] Re: Auth question

2018-10-17 Thread Rahul
Hi Jim, I am afraid no I didn't check that section but I just finished reading it. Thanks! for directing me to it. Looks like a new addition to DAL (might be a couple of versions back) & looks promising. So now, we can specify something like request_tenant using db._common_fields fiel

[web2py] Re: Auth question

2018-10-16 Thread Jim S
Have you looked at common filters? http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=common+filter#Common-filters -Jim On Tuesday, October 16, 2018 at 7:35:04 AM UTC-5, Rahul wrote: > > Hey Everyone, >Greetings! I have a question. I went through Auth doc