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

Enforce User Authorization docs section could be clearer #66

Open
artburkart opened this issue May 6, 2016 · 0 comments
Open

Enforce User Authorization docs section could be clearer #66

artburkart opened this issue May 6, 2016 · 0 comments

Comments

@artburkart
Copy link

Hi,

I noticed the documentation for the Enforce User Authorization section may be a little off.

It says

>>> directory = stormpath_manager.application.default_account_store_mapping.account_store

>>> free_users = directory.groups.create({'name': 'free users'})
>>> paid_users = directory.groups.create({'name': 'paid users'})
>>> admins = directory.groups.create({'name': 'admins'})

>>> # Put the current user into the 'Free Users' group.
>>> user.add_group(free_users)

but I couldn't get it to work unless I used the following

directory = stormpath_manager.application.default_group_store_mapping.account_store

Maybe the library has been updated, but the docs not?

Also, as a point of clarity, it may be helpful to point out creating groups doesn't need to be done in code at all, that it can be done through your UI instead. While I was able to deduce from the >>> that I shouldn't add this code to my app, it may not be entirely clear to a Python newbie that the snippet is only meant to be executed as a one-off in the CLI.

Cheers 😄

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

No branches or pull requests

1 participant