feat(contacts): support federated users/groups search when adding team members#57782
Conversation
|
/backport to stable33 |
…m members Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
…e from member search controller Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
c2832f9 to
1136ce0
Compare
salmart-dev
left a comment
There was a problem hiding this comment.
I think tests need to be adapted with the new changes, the ShareesAPIController tests are failing because of the extra constructor parameter
come-nc
left a comment
There was a problem hiding this comment.
There is no documentation whatsoever about what’s accepted as an $itemType and that’s triggering me.
But not the subject of that PR I suppose.
I’m not sure why TYPE_EMAIL is added to $shareTypes in this new if branch, but is it seems a copypaste from the else with only remote added I guess it makes sense.
@salmart-dev thanks for the input! I'll look into it.
@come-nc thanks for the review! Yes, basically the ideia was to keep the original functionallity (inside |
…ratedShareProvider dependency Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Summary
Adds possibility to search for federated users (accounts from other instances) and federated groups when adding members to a team in the Contacts app.
Context
When searching for members to add to a team in the Contacts app, a GET request is made to
ocs/v2.php/apps/files_sharing/api/v1/shareeswhich in turn callsfiles_sharing/lib/Controller/ShareesAPIController::search().This is the same endpoint used by the Files app when searching to add an external share (used as a reference here, as pointed out in the issue).
Changes
files_sharing/lib/Controller/ShareesAPIController::search()to handlecontactsitemType, allowingTYPE_REMOTEandTYPE_REMOTE_GROUPsearchesFederatedShareProviderinto the controller constructor to check federation settingsFederatedShareProviderisRemoteSharingAllowed()andisRemoteGroupSharingAllowed()require a share backend implementationisShareTypeAllowed(), which ultimately invokes the sameFederatedShareProvidermethods used in this implementation (isOutgoingServer2serverShareEnabled()andisOutgoingServer2serverGroupShareEnabled())Note
When testing locally, the federated search functionality works correctly (remote users appear in search results). However, when attempting to actually add the remote member to a team, an error occurs indicating the remote instance is unreachable. I believe this is expected behavior when running locally, as a similar error occurs when trying to add an external share in the Files app using the same remote account, which is the reference implementation mentioned in the issue and was not modified in this PR.
Checklist
3. to review, feature component)stable32)