Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document root/session factory overriding #78

Open
Zitrax opened this issue Jul 17, 2016 · 2 comments
Open

Document root/session factory overriding #78

Zitrax opened this issue Jul 17, 2016 · 2 comments

Comments

@Zitrax
Copy link

Zitrax commented Jul 17, 2016

This was something that took me quite a while to figure out since it was not obvious to me how to do it. I wanted to use my own root factory (e.g. MyRootFactory), and the code:

# register root factory, only if not set already
if configurator.registry.queryUtility(IRootFactory) is None:
    configurator.set_root_factory(
        'pyramid_fullauth.auth.BaseACLRootFactoryMixin')

confused me. In the end I found out that I could do:

configurator.registry.registerUtility(MyRootFactory, IRootFactory)

to make sure my factory was used instead.

How did you indent this to be used ? I ended up doing this only since I did not find another way that worked - so I am guessing it might not be the most natural way.

Would be nice with some documentation describing this, possibly with a small example.

@fizyk
Copy link
Owner

fizyk commented Jul 17, 2016

@Zitrax basically all of the auth factories are set only if they haven't been set already. So possibly all of that could be described.

Either that, or add the possibility to configure and extend current acl.

Just out of curiosity, what does your root factory contains?

@Zitrax
Copy link
Author

Zitrax commented Jul 17, 2016

I wanted a generic name for the 's:user' so I basically changed the ('password_change', 'email_change') to 'user'.

In addition I did not want to care about inactive vs active users at this point, so allowing 's:inactive' in addition. But that's something I'll probably change later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants