Open JoeGaffney opened 1 month ago
Hey @JoeGaffney thanks for the issue. We are open to contributions for this one.
Hey @BatuhanW i would like to work on this issue. can you please assign it to me?
Hey @JayBhensdadia assigned to you.
Please make sure to thoroughly read and follow our contribution guide. PRs that doesn't follow our contribution guide, will be closed.
sure
This issue is related with our sider components (ThemedSiderV2
etc.). In the <CanAccess />
wrappers of the menu items we're sending the resource.name
with toLowerCase()
. Since we don't have this transform in any other usages of useCan
or <CanAccess />
I don't think this is going to be a breaking change because user already needs to handle both lower cased and non-transformed resource names 🤔
ah that makes sense with the pattern I was seeing ( some cases changes and others not)
I did have a resource defined with only a show and not a list in the resources that was camel and was not affected. So would not appear in the side panel and thus probably not go through the canAccess first from the sider
Describe the bug
Sometimes resource names can get changed to lower case even though they are Camel cased.
Will then appear as auditlogs in the access control Can method
Steps To Reproduce
Create a camelCase resouce.
Log the resource name in the accessControl.
export const accessControlProvider = {{ can: async ({{ resource, action, params }}) => {{ console.log(resource) console.log("Resource Name:", params?.resource?.name); ... }}, }};
Expected behavior
Not to change the casing
Packages
Additional Context
Was mentioned on discord to put a ticket in @aliemir said he has a solution.
Potentially somehow related to kbar?