Skip to content

Enforce User Authorization docs section could be clearer #66

@artburkart

Description

@artburkart

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 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions