guest role; guide section ticking
This commit is contained in:
@@ -784,13 +784,20 @@ def fix_controls_direction():
|
||||
@seed_cli.command('permissions')
|
||||
@with_appcontext
|
||||
def seed_permissions():
|
||||
"""Seed predefined permissions."""
|
||||
"""Seed predefined permissions, and the guest role that can hold them."""
|
||||
from shopdb.extensions import db
|
||||
from shopdb.core.models import Permission
|
||||
from shopdb.core.models import Permission, Role
|
||||
|
||||
created = Permission.seed()
|
||||
# Seeded here rather than in `seed admin` so an existing site picks it up
|
||||
# on the upgrade it already runs. It holds nothing until somebody grants
|
||||
# it something, so seeding it changes no behaviour.
|
||||
guest = Role.seedguest()
|
||||
db.session.commit()
|
||||
click.echo(click.style(f"{created} permissions created.", fg='green'))
|
||||
if guest:
|
||||
click.echo(click.style(
|
||||
"guest role created (holds no permissions).", fg='green'))
|
||||
|
||||
|
||||
@seed_cli.command('settings')
|
||||
|
||||
Reference in New Issue
Block a user