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:
parent
0cf2fc9c24
commit
fa454a8e47
2 changed files with 4 additions and 1 deletions
|
@ -1,7 +1,9 @@
|
|||
{{#if this.session.user.isOwnerOrAdmin}}
|
||||
<span
|
||||
class="segment-totals"
|
||||
{{did-insert (perform this.fetchTotalsTask)}}
|
||||
{{did-update (perform this.fetchSegmentTotalTask) @segment}}
|
||||
>
|
||||
{{format-number this.segmentTotal}} / {{format-number this.total}} members
|
||||
</span>
|
||||
</span>
|
||||
{{/if}}
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue