-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Include users membership in group in summary API #2382
Conversation
synapse/storage/group_server.py
Outdated
}, | ||
retcols=("is_admin", "is_public"), | ||
allow_none=True, | ||
desc="is_user_adim_in_group", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you meant 'admin'
synapse/storage/group_server.py
Outdated
|
||
if row: | ||
return { | ||
"memebrship": "joined", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"meme br ship"?
synapse/storage/group_server.py
Outdated
|
||
if row: | ||
return { | ||
"membership": "joined", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I thought we generally used "join" rather than "joined", "invite" rather than "invited" and "leave" rather than "left" etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probs
synapse/storage/group_server.py
Outdated
return { | ||
"membership": "joined", | ||
"is_public": row["is_public"], | ||
"is_privileged": row["is_admin"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've somewhat lost track of whether we call this "admin" or "privileged" in the rest of the API. Is it intentional that we are calling this "admin" internally and "privileged" externally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, basically its a bit handy wavey the exact semantics for the admin/visibility stuff. is_privileged
is a basically something that goes down the read APIs to tell the clients that "this person has some power, so just let them try and do stuff and see if they get a 403"
Codewise LGTM. I've left some quibbles about the API for you though. |
synapse/storage/group_server.py
Outdated
Example if joined: | ||
|
||
{ | ||
"membership": "joined", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe update the example as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise
No description provided.