Skip to content

Auth: add_permission problem ... #452

Answered by gi0baro
1st-github-account asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @1st-github-account, this is actually wrong documented. Gonna update the docs ASAP.

You can convert your code to:

@app.command('setup')
def setup():
    with db.connection():
        user = User.create(email="lu@localhost", first_name="Lu",last_name="",password="pw")
        admins = auth.create_group('admins')
        admins.users.add(user)
        admins.auth_permissions.create(name="ban_users")
        db.commit()

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@1st-github-account
Comment options

Answer selected by 1st-github-account
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants