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

fix(core): ensure consistent casing in resource names for access control #6021

Conversation

JayBhensdadia
Copy link
Contributor

@JayBhensdadia JayBhensdadia commented Jun 6, 2024

PR Checklist

Bugs / Features

What is the current behavior?

The current behavior intermittently lower cases resources due to inconsistent handling of resource names.

What is the new behavior?

The new behavior ensures consistent casing of resource names, addressing the issue of intermittent lower casing.

fixes #6004

Notes for reviewers

This PR addresses the intermittent issue where resource names were being lower-cased. The fix ensures consistent casing throughout the access control logic.

@JayBhensdadia JayBhensdadia requested a review from a team as a code owner June 6, 2024 16:51
Copy link

changeset-bot bot commented Jun 6, 2024

🦋 Changeset detected

Latest commit: 2d0cde5

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

This PR includes changesets to release 5 packages
Name Type
@refinedev/chakra-ui Patch
@refinedev/mantine Patch
@refinedev/antd Patch
@refinedev/mui Patch
@refinedev/ui-tests 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

@BatuhanW
Copy link
Member

BatuhanW commented Jun 7, 2024

Hey @JayBhensdadia thanks for the PR! Can you add some tests to reproduce the problem, so we make sure these changes fixes the issue?

@BatuhanW BatuhanW added this to the July Release milestone Jun 7, 2024
@JayBhensdadia
Copy link
Contributor Author

sure, i'll do that!

@JayBhensdadia JayBhensdadia force-pushed the fix/access-control-lowercase-resources branch from e4d98ab to cfd4dd7 Compare June 8, 2024 14:32
@JayBhensdadia
Copy link
Contributor Author

JayBhensdadia commented Jun 8, 2024

hey, @BatuhanW
i have added tests
and ran across all four ui libraries (antd, chakra-ui, mantine, mui)
got consistent behaviour
please review!

Copy link
Member

@aliemir aliemir left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution! Great PR 🚀

Can you add a changeset for the packages as well? You can check out our Contributing Guide to learn how. It will be great if you can add two changesets, one for @refinedev/ui-tests and other for UI packages 🙏

Let me know if any help is needed 🤖

Copy link
Member

Choose a reason for hiding this comment

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

Changes in this file is OK to keep but we can revert the changes in versioned_docs/version-3.xx.xx 🙏

expect(() => getByText("Users")).toThrow();
});

it("should handle camelcased resource names correctly", async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Tests looks great and nice to see you've implemented them in ui-tests 🤝

@JayBhensdadia
Copy link
Contributor Author

Sure, I'll start working on it!

@JayBhensdadia
Copy link
Contributor Author

hey @aliemir
I've added the changeset for @refinedev/ui-tests and the UI packages as requested. Please review the updates. Thank you!

Copy link
Member

@aliemir aliemir left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution @JayBhensdadia 🎖️ I reverted the changes in documentation/versioned_docs and kept them untouched 🙏

@JayBhensdadia
Copy link
Contributor Author

Sorry, I missed that change about versioned_docs !

Copy link
Member

@BatuhanW BatuhanW left a comment

Choose a reason for hiding this comment

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

Great job @JayBhensdadia

@BatuhanW BatuhanW changed the base branch from master to releases/july June 20, 2024 08:47
@BatuhanW BatuhanW merged commit 55cd066 into refinedev:releases/july Jun 20, 2024
25 of 27 checks passed
@aliemir aliemir mentioned this pull request Jun 20, 2024
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.

[BUG] Access Control lower cases resources intermittently
3 participants