-
Notifications
You must be signed in to change notification settings - Fork 334
WPB-20214: Add member searchability #4786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
8389bc2
432f3a9
a05f673
4d42852
4c410b3
5e593b6
e61637f
89a3ecc
8c1b1c4
dcc4d68
c254463
533843c
a45eaa2
5c98c60
9e4d473
e10f7fe
53d567f
6a555cf
1a067b6
79075dc
a358288
bd8edf4
03b435c
953002a
0bcedd7
9588db7
253916e
ea5dadb
a0c4342
f45b4f9
bbe9195
fcdf8fb
46f0602
9415d7f
dfba1fd
1620fe4
d8fb31c
2ced710
7b3b5e5
3534343
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Add `searchable` field to users, users who have it set to `false` won't be found by the public endpoint. | ||
Add `POST /users/:uid/searchable` endpoint where team admin can change it for user. | ||
Add `/teams/:tid/search?searchable=false`, where the query parameter makes it return only non-searchable users. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,7 +161,6 @@ instance AsUnion DeleteSelfResponses (Maybe Timeout) where | |
type ConnectionUpdateResponses = UpdateResponses "Connection unchanged" "Connection updated" UserConnection | ||
|
||
type UserAPI = | ||
-- See Note [ephemeral user sideeffect] | ||
Named | ||
Comment on lines
163
to
164
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of 'See Note [ephemeral user sideeffect]' comments appears unrelated to the searchability feature. These documentation changes should be part of a separate commit focused on documentation cleanup. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
"get-user-unqualified" | ||
( Summary "Get a user by UserId" | ||
|
@@ -171,16 +170,14 @@ type UserAPI = | |
:> CaptureUserId "uid" | ||
:> GetUserVerb | ||
) | ||
:<|> | ||
-- See Note [ephemeral user sideeffect] | ||
Named | ||
"get-user-qualified" | ||
( Summary "Get a user by Domain and UserId" | ||
:> ZLocalUser | ||
:> "users" | ||
:> QualifiedCaptureUserId "uid" | ||
:> GetUserVerb | ||
) | ||
:<|> Named | ||
"get-user-qualified" | ||
( Summary "Get a user by Domain and UserId" | ||
:> ZLocalUser | ||
:> "users" | ||
:> QualifiedCaptureUserId "uid" | ||
:> GetUserVerb | ||
) | ||
:<|> Named | ||
"update-user-email" | ||
( Summary "Resend email address validation email." | ||
|
@@ -224,19 +221,17 @@ type UserAPI = | |
] | ||
(Maybe UserProfile) | ||
) | ||
:<|> | ||
-- See Note [ephemeral user sideeffect] | ||
Named | ||
"list-users-by-unqualified-ids-or-handles" | ||
( Summary "List users (deprecated)" | ||
:> Until 'V2 | ||
:> Description "The 'ids' and 'handles' parameters are mutually exclusive." | ||
:> ZUser | ||
:> "users" | ||
:> QueryParam' [Optional, Strict, Description "User IDs of users to fetch"] "ids" (CommaSeparatedList UserId) | ||
:> QueryParam' [Optional, Strict, Description "Handles of users to fetch, min 1 and max 4 (the check for handles is rather expensive)"] "handles" (Range 1 4 (CommaSeparatedList Handle)) | ||
:> Get '[JSON] [UserProfile] | ||
) | ||
:<|> Named | ||
"list-users-by-unqualified-ids-or-handles" | ||
( Summary "List users (deprecated)" | ||
:> Until 'V2 | ||
:> Description "The 'ids' and 'handles' parameters are mutually exclusive." | ||
:> ZUser | ||
:> "users" | ||
:> QueryParam' [Optional, Strict, Description "User IDs of users to fetch"] "ids" (CommaSeparatedList UserId) | ||
:> QueryParam' [Optional, Strict, Description "Handles of users to fetch, min 1 and max 4 (the check for handles is rather expensive)"] "handles" (Range 1 4 (CommaSeparatedList Handle)) | ||
:> Get '[JSON] [UserProfile] | ||
) | ||
:<|> Named | ||
"list-users-by-ids-or-handles" | ||
( Summary "List users" | ||
|
@@ -247,18 +242,16 @@ type UserAPI = | |
:> ReqBody '[JSON] ListUsersQuery | ||
:> Post '[JSON] ListUsersById | ||
) | ||
:<|> | ||
-- See Note [ephemeral user sideeffect] | ||
Named | ||
"list-users-by-ids-or-handles@V3" | ||
( Summary "List users" | ||
:> Description "The 'qualified_ids' and 'qualified_handles' parameters are mutually exclusive." | ||
:> ZUser | ||
:> Until 'V4 | ||
:> "list-users" | ||
:> ReqBody '[JSON] ListUsersQuery | ||
:> Post '[JSON] [UserProfile] | ||
) | ||
:<|> Named | ||
"list-users-by-ids-or-handles@V3" | ||
( Summary "List users" | ||
:> Description "The 'qualified_ids' and 'qualified_handles' parameters are mutually exclusive." | ||
:> ZUser | ||
:> Until 'V4 | ||
:> "list-users" | ||
:> ReqBody '[JSON] ListUsersQuery | ||
:> Post '[JSON] [UserProfile] | ||
) | ||
:<|> Named | ||
"send-verification-code" | ||
( Summary "Send a verification code to a given email address." | ||
|
@@ -294,6 +287,17 @@ type UserAPI = | |
'[JSON] | ||
(Respond 200 "Protocols supported by the user" (Set BaseProtocolTag)) | ||
) | ||
:<|> Named | ||
"set-user-searchable" | ||
( Summary "Set user's visibility in search" | ||
:> From 'V12 | ||
:> ZLocalUser | ||
:> "users" | ||
:> CaptureUserId "uid" | ||
:> ReqBody '[JSON] Bool | ||
:> "searchable" | ||
:> Post '[JSON] () | ||
) | ||
|
||
type LastSeenNameDesc = Description "`name` of the last seen user group, used to get the next page when sorting by name." | ||
|
||
|
@@ -1735,6 +1739,13 @@ type SearchAPI = | |
] | ||
"email" | ||
EmailVerificationFilter | ||
:> QueryParam' | ||
[ Optional, | ||
Strict, | ||
Description "Optional, return only non-searchable members when false." | ||
] | ||
"searchable" | ||
Bool | ||
:> MultiVerb | ||
'GET | ||
'[JSON] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,9 @@ serviceWhitelistPermissions = | |
-- Perm | ||
|
||
-- | Team-level permission. Analog to conversation-level 'Action'. | ||
-- | ||
-- If you ever think about adding a new permission flag, read Note | ||
-- [team roles] first. | ||
Comment on lines
+131
to
+133
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] The comment about reading 'Note [team roles]' was moved from after the data type definition to before it, but the new Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
data Perm | ||
= CreateConversation | ||
| -- NOTE: This may get overruled by conv level checks in case those are more restrictive | ||
|
@@ -153,8 +156,6 @@ data Perm | |
| DeleteTeam | ||
-- FUTUREWORK: make the verbs in the roles more consistent | ||
-- (CRUD vs. Add,Remove vs; Get,Set vs. Create,Delete etc). | ||
-- If you ever think about adding a new permission flag, | ||
-- read Note [team roles] first. | ||
deriving stock (Eq, Ord, Show, Enum, Bounded, Generic) | ||
deriving (Arbitrary) via (GenericUniform Perm) | ||
deriving (FromJSON, ToJSON) via (CustomEncoded Perm) | ||
|
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.
This change from pattern matching to direct function composition appears to be unrelated to the searchability feature. Consider moving this refactoring to a separate commit or PR to maintain clear separation of concerns.
Copilot uses AI. Check for mistakes.