Skip to content

Commit

Permalink
permissions: allow billing.manage to view all billings
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Feb 19, 2024
1 parent e0ad2e4 commit 4774584
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weblate/auth/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def check_team_edit_users(user, permission, obj):
@register_perm("billing.view")
def check_billing_view(user, permission, obj):
if hasattr(obj, "all_projects"):
if user.is_superuser or obj.owners.filter(pk=user.pk).exists():
if user.has_perm("billing.manage") or obj.owners.filter(pk=user.pk).exists():
return True
# This is a billing object
return any(check_permission(user, permission, prj) for prj in obj.all_projects)
Expand Down

0 comments on commit 4774584

Please sign in to comment.