Skip to content

Commit

Permalink
fix: migrate_roles (apache#16098)
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida authored and Emmanuel Bavoux committed Nov 14, 2021
1 parent b1e6cd0 commit ee2cc8c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
revision = "f6196627326f"
down_revision = "143b6f2815da"

NEW_PVMS = {"Chart": ("can_read",)}
PVM_MAP = {
Pvm("Chart", "can_get_data"): (Pvm("Chart", "can_read"),),
Pvm("Chart", "can_post_data"): (Pvm("Chart", "can_read"),),
Expand All @@ -49,6 +50,7 @@ def upgrade():
session = Session(bind=bind)

# Add the new permissions on the migration itself
add_pvms(session, NEW_PVMS)
migrate_roles(session, PVM_MAP)
try:
session.commit()
Expand Down

0 comments on commit ee2cc8c

Please sign in to comment.