FIX: correct group membership on cards for admins
This commit is contained in:
parent
1bb12ee1b6
commit
3d1ff8e0ad
|
@ -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}}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue