summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorLuke Barnard <lukebarnard1@users.noreply.github.com>2017-11-07 12:05:11 +0000
committerGitHub <noreply@github.com>2017-11-07 12:05:11 +0000
commit1bd654dabde776bbb7ee365c115b307cd6a110b8 (patch)
tree769917ca0abb14e2cab4dd979e397dd10bebe0a7 /synapse
parentMerge pull request #2576 from maximevaillancourt/exclude-noscript-url-preview (diff)
parentRemember to pick is_admin out of the db (diff)
downloadsynapse-1bd654dabde776bbb7ee365c115b307cd6a110b8.tar.xz
Merge pull request #2647 from matrix-org/luke/get-group-users-is-privileged
Return whether a user is an admin within a group
Diffstat (limited to 'synapse')
-rw-r--r--synapse/groups/groups_server.py5
-rw-r--r--synapse/storage/group_server.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/synapse/groups/groups_server.py b/synapse/groups/groups_server.py
index addc70ce94..11199dd215 100644
--- a/synapse/groups/groups_server.py
+++ b/synapse/groups/groups_server.py
@@ -426,14 +426,15 @@ class GroupsServerHandler(object):
         for user_result in user_results:
             g_user_id = user_result["user_id"]
             is_public = user_result["is_public"]
+            is_privileged = user_result["is_admin"]
 
             entry = {"user_id": g_user_id}
 
             profile = yield self.profile_handler.get_profile_from_cache(g_user_id)
             entry.update(profile)
 
-            if not is_public:
-                entry["is_public"] = False
+            entry["is_public"] = bool(is_public)
+            entry["is_privileged"] = bool(is_privileged)
 
             if not self.is_mine_id(g_user_id):
                 attestation = yield self.store.get_remote_attestation(group_id, g_user_id)
diff --git a/synapse/storage/group_server.py b/synapse/storage/group_server.py
index f6924e1a32..6b261dcc0f 100644
--- a/synapse/storage/group_server.py
+++ b/synapse/storage/group_server.py
@@ -54,7 +54,7 @@ class GroupServerStore(SQLBaseStore):
         return self._simple_select_list(
             table="group_users",
             keyvalues=keyvalues,
-            retcols=("user_id", "is_public",),
+            retcols=("user_id", "is_public", "is_admin",),
             desc="get_users_in_group",
         )