Closed peletiah closed 8 years ago
Oh and is there by chance a project somewhere which uses all the features? I'm having difficulties grasping the concept of resources, specifically how to use the data-structure in the Resource-class.
As for your first question:
Getting DBSession
ziggurat_foundations.models.DBSession = DBSession
This is critical to be present because ziggurat_foundation models do not know your package name so you have to pass it to ziggurat namespace for them to pick up - the is no way around this even with vanilla scaffold - btw. new 1.7.x or 1.8 pyramid scaffold will not have global scoped session object.
Permissions not working as expected
True, this was a mistake in the documentation - the examples appended username as the user identifier where in fact pyramid's remember() gets user id, so they never were matched. I've provided a pull request to your example that corrects that and I've updated the documentation to showcase even better way of handling ACL's that normalizes user/group handling.
I will be releasing a separate scaffold that builds a small system incorporating multiple packages at once - but its not there yet.
I will be releasing a separate scaffold
Great, looking forward to it!
Thanks for the quick fix regarding permissions and docs!
I'll try to figure out resources and implement them in my demo.
I'm having trouble following the configuration and usage guide. Is it ok to ask for support here?
I've setup a Pyramid project with SQLAlchemy-scaffold and added all the configuration-changes as described in the docs.
First thing I'm running into is an issue with get_db_session:
Getting DBSession
In my models.py
DBSession
is defined asThis is the alchemy-scaffold default. Shouldn't
ziggurat_foundations.models.base.get_db_session
be able to findmyapp.models.DBSession
? Since that didn't work for me, I can make basic login work with the other two approaches that are pointed out in the docs ("get_session_callable" and "ziggurat_foundations.models.DBSession = DBSession"). But should it work without these definitions?Permissions not working as expected
The second issue is the view-permission. Clearly my users permissions are added to the RootFactory's acl:
but it is not honored when I try to access a view with a permission (E.g. I have a "edit_note"-view with an "edit"-permission which should be accessible when user "editor" is logged in).
When I switch the permission to "view", it works for authenticated users (As expected) - but not the dynamic permission in the acl.
What am I missing?
I've uploaded the full code I'm using to https://github.com/peletiah/ziggurat_auth_demo (incl. DB-dump)