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(backend): Introduce OrganizationRoleAPI #2177

Merged
merged 6 commits into from
Nov 22, 2023

Conversation

panteliselef
Copy link
Member

@panteliselef panteliselef commented Nov 21, 2023

Description

Add OrganizationRoleAPI for CRUD operations regarding instance level organization roles.

This will be backported

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/backend
  • @clerk/chrome-extension
  • @clerk/clerk-js
  • @clerk/clerk-expo
  • @clerk/fastify
  • gatsby-plugin-clerk
  • @clerk/localizations
  • @clerk/nextjs
  • @clerk/clerk-react
  • @clerk/remix
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/themes
  • @clerk/types
  • build/tooling/chore

Copy link

changeset-bot bot commented Nov 21, 2023

🦋 Changeset detected

Latest commit: 16d9e5d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@clerk/backend Patch
@clerk/fastify Patch
gatsby-plugin-clerk Patch
@clerk/nextjs Patch
@clerk/remix Patch
@clerk/clerk-sdk-node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR


const basePath = '/organizations_roles';

type GetOrganizationRoleListParams = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 We also support query & order_by parameters

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chanioxaris is order_by a string or can i provide a stricter type ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a string

name: string;
key: string;
description: string;
permissions: string[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 The permissions are an array of permission objects

name?: string;
description?: string;
//TODO(@pantelis): Will this override or union ?
permissions?: string[];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chanioxaris when updating permissions, is it an addition or override ?

Copy link
Member

@chanioxaris chanioxaris Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an override. For additions, you have to use the dedicated endpoint. Of course, if you don't specify any property, we won't update them

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ permissions: undefined } // will not override
{ permissions: [] } // will assign no perms to a role

@chanioxaris is the above correct ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct!

@panteliselef panteliselef added this pull request to the merge queue Nov 22, 2023
Merged via the queue into main with commit b3a3dcd Nov 22, 2023
7 checks passed
@panteliselef panteliselef deleted the elef/core-865-roles-api branch November 22, 2023 13:45
desiprisg pushed a commit that referenced this pull request Nov 23, 2023
* feat(backend): Introduce OrganizationRoleAPI

* test(backend): Update exports.test.ts

* test(clerk-sdk-node): Update exports

* test(nextjs): Update exports.test.ts.snap

* feat(backend): Address PR comments

* chore(backend): Rename OrganizationRole to Role
panteliselef added a commit that referenced this pull request Dec 4, 2023
github-merge-queue bot pushed a commit that referenced this pull request Dec 4, 2023
…RoleAPI (#2252)

* Revert "feat(backend): Introduce OrganizationRoleAPI (#2177)"

This reverts commit b3a3dcd

* Revert "feat(backend): Introduce OrganizationPermissionAPI (#2178)"

This reverts commit 0ce0edc

* chore(backend): Add changeset

* chore(backend): Keep the previous changesets
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.

None yet

4 participants