googleapis/google-api-ruby-client

`Google::Apis::AdminDirectoryV1::DirectoryService#insert_member` seems to ignore group’s `whoCanJoin` setting

Closed this issue · 1 comments

Hi there!

So we have some mail groups with whoCanJoin setting to CAN_REQUEST_TO_JOIN, It will raise error and fail if we try to add a user outside our domain from browser (https://groups.google.com/), which is expected.
But when adding user through Google::Apis::AdminDirectoryV1::DirectoryService#insert_member api, outside user will be added without any problem despite the whoCanJoin setting. Is this expected behavior or did I miss something?

Environment details

  • Ruby version: 3.3.0
  • Gem name and version: google-apis-admin_directory_v1@0.53.0

Below is whoCan part of our group settings.

{
  "whoCanAdd": "ALL_MANAGERS_CAN_ADD",
  "whoCanAddReferences": "NONE",
  "whoCanApproveMembers": "ALL_MANAGERS_CAN_APPROVE",
  "whoCanApproveMessages": "OWNERS_AND_MANAGERS",
  "whoCanAssignTopics": "NONE",
  "whoCanAssistContent": "NONE",
  "whoCanBanUsers": "OWNERS_AND_MANAGERS",
  "whoCanContactOwner": "ANYONE_CAN_CONTACT",
  "whoCanDeleteAnyPost": "OWNERS_AND_MANAGERS",
  "whoCanDeleteTopics": "OWNERS_AND_MANAGERS",
  "whoCanDiscoverGroup": "ALL_IN_DOMAIN_CAN_DISCOVER",
  "whoCanEnterFreeFormTags": "NONE",
  "whoCanHideAbuse": "NONE",
  "whoCanInvite": "ALL_MANAGERS_CAN_INVITE",
  "whoCanJoin": "CAN_REQUEST_TO_JOIN",
  "whoCanLeaveGroup": "ALL_MEMBERS_CAN_LEAVE",
  "whoCanLockTopics": "OWNERS_AND_MANAGERS",
  "whoCanMakeTopicsSticky": "NONE",
  "whoCanMarkDuplicate": "NONE",
  "whoCanMarkFavoriteReplyOnAnyTopic": "NONE",
  "whoCanMarkFavoriteReplyOnOwnTopic": "NONE",
  "whoCanMarkNoResponseNeeded": "NONE",
  "whoCanModerateContent": "OWNERS_AND_MANAGERS",
  "whoCanModerateMembers": "OWNERS_AND_MANAGERS",
  "whoCanModifyMembers": "OWNERS_AND_MANAGERS",
  "whoCanModifyTagsAndCategories": "NONE",
  "whoCanMoveTopicsIn": "OWNERS_AND_MANAGERS",
  "whoCanMoveTopicsOut": "OWNERS_AND_MANAGERS",
  "whoCanPostAnnouncements": "OWNERS_AND_MANAGERS",
  "whoCanPostMessage": "ANYONE_CAN_POST",
  "whoCanTakeTopics": "NONE",
  "whoCanUnassignTopic": "NONE",
  "whoCanUnmarkFavoriteReplyOnAnyTopic": "NONE",
  "whoCanViewGroup": "ALL_MEMBERS_CAN_VIEW",
  "whoCanViewMembership": "ALL_MEMBERS_CAN_VIEW"
}

Unfortunately, we can't help you in this github repository; this is just automatically-generated open source client libraries for the various Google APIs. For questions related to the functionality of the service, you'll need to contact Google support for the product you're using: https://developers.google.com/admin-sdk/support