FIX: correct group membership on cards for admins

This commit is contained in:
Jeff Wong 2018-06-12 14:57:26 -07:00
parent 1bb12ee1b6
commit 3d1ff8e0ad
2 changed files with 10 additions and 2 deletions

View File

@ -47,7 +47,7 @@
{{ group.user_count }}
</h3>
<h3>
{{#if group.is_group_owner}}
{{#if group.is_group_owner_display}}
{{i18n "groups.index.is_group_owner"}}
{{else if group.is_group_user}}

View File

@ -1,5 +1,5 @@
class GroupShowSerializer < BasicGroupSerializer
attributes :is_group_user, :is_group_owner, :mentionable, :messageable
attributes :is_group_user, :is_group_owner, :is_group_owner_display, :mentionable, :messageable
def include_is_group_user?
authenticated?
@ -17,6 +17,14 @@ class GroupShowSerializer < BasicGroupSerializer
scope.is_admin? || fetch_group_user&.owner
end
def include_is_group_owner_display?
authenticated?
end
def is_group_owner_display
!!fetch_group_user&.owner
end
def include_mentionable?
authenticated?
end