I just uncovered something I did not expect, I was trying to place access controls on a tab field and while TypeScript allows it (meaning the fields are defined), the controls are not being respected. Can anyone else confirm or does anyone have any info on why this may not be supported?
Willing to file issue if it's needed but wanted to reach out and see if maybe this was by design.
What I'm trying to do:
{
// ...
tabs: [
{
label: 'User Info',
fields: [
// ...
]
},
{
label: 'Access',
access: {
read: ({ req }) => {
return isGlobalAdmin(req.user);
},
},
fields: [
//...
}
// ...
]
// ...
}
My expectation was that for this user, which is not isGlobalAdmin the tab would not be visible.
The isGlobalAdmin has been used elswere on many other fields (and being called as part of other access checks). It's know to be working it is just that a tab field is not respecting the filter.