Skip to content
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

feat: clone permissions and members for group creation #443

Merged
merged 5 commits into from
Feb 5, 2025

Conversation

golanglemonade
Copy link
Member

@golanglemonade golanglemonade commented Feb 5, 2025

  • Allows a group to be created by cloning permissions and members from another group
  • Allows a group to be updated by cloning permission from another group, these will be added in addition to existing permissions the group already has
  • **updates do no allow cloning members
  • tests added to ensure permissions + members get added
  • TODOs in here because we should automate this with codegen, but will follow-up later on that.
mutation CreateGroupByClone($groupInput: CreateGroupInput!, $inheritGroupPermissions: ID, $cloneGroupMembers: ID) {
  createGroupByClone(groupInput: $groupInput, inheritGroupPermissions: $inheritGroupPermissions, cloneGroupMembers: $cloneGroupMembers) {
    group {
      id
      displayID
      members {
        id
        user {
          firstName
          lastName
        }
      }
      permissions {
        id
        displayID
        name
        objectType
        permissions
      }
    }
  }
}

{
  "groupInput": {
    "name": "meow - clone 1",
    "ownerID": "01JK9HQGPQ83WJ1FECFF3CET8B"
  },
"inheritGroupPermissions": "01JK9HSDCMSS6SR6J819SQXQTE",
"cloneGroupMembers": "01JK9HSDCMSS6SR6J819SQXQTE"
}
{
  "data": {
    "createGroupByClone": {
      "group": {
        "id": "01JKACN698VMW5T4PR078CFFWP",
        "displayID": "GRP-R5FVNO",
        "members": [
          {
            "id": "01JKACN69HFXWZFNMMAWKTBYQ4",
            "user": {
              "firstName": "matt",
              "lastName": "anderson"
            }
          }
        ],
        "permissions": [
          {
            "id": "01JKA2F8ZDP37RQQ12PT8SYMKE",
            "displayID": "CTL-7WA2WG",
            "name": "CC2.4",
            "objectType": "Control",
            "permissions": "VIEWER"
          },
          {
            "id": "01JKA2FPH5PCA69M16768QT6R4",
            "displayID": "CTL-SSI5FI",
            "name": "CC1.3",
            "objectType": "Control",
            "permissions": "VIEWER"
          },
          {
            "id": "01JK9J0GFEQP9KRSBB8R9357JT",
            "displayID": "PRG-IF2HCA",
            "name": "Risk Mitigation - 2025",
            "objectType": "Program",
            "permissions": "EDITOR"
          }
        ]
      }
    }
  },
  "extensions": {
    "auth": {
      "authentication_type": "pat",
      "authorized_organization": "01JK9HQGPQ83WJ1FECFF3CET8B"
    },
    "server_latency": "510.283166ms",
    "trace_id": "ogmFGLVYEHUXMSmTABBLkBJrAxfDwxTf"
  }
}

Signed-off-by: Sarah Funkhouser <[email protected]>
Signed-off-by: Sarah Funkhouser <[email protected]>
Signed-off-by: Sarah Funkhouser <[email protected]>
Signed-off-by: Sarah Funkhouser <[email protected]>
Signed-off-by: Sarah Funkhouser <[email protected]>
@golanglemonade golanglemonade changed the title wip: clone permissions for group feat: clone permissions and members for group creation Feb 5, 2025
@golanglemonade golanglemonade marked this pull request as ready for review February 5, 2025 20:37
@golanglemonade golanglemonade requested a review from a team as a code owner February 5, 2025 20:37
@golanglemonade golanglemonade enabled auto-merge (squash) February 5, 2025 21:02
@golanglemonade golanglemonade merged commit d836330 into main Feb 5, 2025
17 checks passed
@golanglemonade golanglemonade deleted the feat-group-inherit branch February 5, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants