Skip to content

Commit

Permalink
Add backfill MANAGE_SHARES migration script - fix existing permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpzx committed Nov 18, 2024
1 parent 90d5705 commit 69c49ba
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ def upgrade():
group_uri=group.groupUri,
tenant_name=TENANT_NAME,
)
TenantPolicyService.associate_permission_to_tenant_policy(session, policy, MANAGE_SHARES)
already_associated = TenantPolicyRepository.has_group_tenant_permission(
session,
group_uri=group.groupUri,
permission_name=MANAGE_SHARES,
tenant_name=TENANT_NAME,
)

if not already_associated:
TenantPolicyService.associate_permission_to_tenant_policy(session, policy, MANAGE_SHARES)


def downgrade():
Expand Down

0 comments on commit 69c49ba

Please sign in to comment.