0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Hid segment count for non-admins

refs https://github.com/TryGhost/Team/issues/496
refs https://github.com/TryGhost/Team/issues/581

Only owners and admins have browse access to members so they are the only ones able to fetch member counts. Don't render segment counts if there's no permission because we'll get errors back from the API and the count will be useless.
This commit is contained in:
Kevin Ansfield 2021-05-07 10:25:44 +01:00
parent 0cf2fc9c24
commit fa454a8e47
2 changed files with 4 additions and 1 deletions

View file

@ -1,3 +1,4 @@
{{#if this.session.user.isOwnerOrAdmin}}
<span
class="segment-totals"
{{did-insert (perform this.fetchTotalsTask)}}
@ -5,3 +6,4 @@
>
{{format-number this.segmentTotal}} / {{format-number this.total}} members
</span>
{{/if}}

View file

@ -5,6 +5,7 @@ import {tracked} from '@glimmer/tracking';
export default class GhMembersSegmentCountComponent extends Component {
@service store;
@service session;
@tracked total = 0;
@tracked segmentTotal = 0;