-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
🐛 RLS form not showing all datasets available #28638
Comments
To resolve the issue where the dataset drop-down in the RLS rule creation pop-up in Superset does not show all available datasets unless a role is selected first, ensure that the Check the const loadTableOptions = useMemo(
() =>
(input = '', page: number, pageSize: number) => {
const query = rison.encode({
filter: input,
page,
page_size: pageSize,
});
return SupersetClient.get({
endpoint: `/api/v1/rowlevelsecurity/related/tables?q=${query}`,
}).then(response => {
const list = response.json.result.map(
(item: { value: number; text: string }) => ({
label: item.text,
value: item.value,
}),
);
return { data: list, totalCount: response.json.count };
});
},
[],
);
<AsyncSelect
ariaLabel={t('Tables')}
mode="multiple"
onChange={onTablesChange}
value={(currentRule?.tables as SelectValue[]) || []}
options={loadTableOptions}
/> Ensure that Additionally, verify that the const getRelatedTablesEndpoint =
'glob:*/api/v1/rowlevelsecurity/related/tables?q*';
const getRelatedRolesEndpoint =
'glob:*/api/v1/rowlevelsecurity/related/roles?q*';
fetchMock.get(getRelatedTablesEndpoint, mockGetTablesResult);
fetchMock.get(getRelatedRolesEndpoint, mockGetRolesResult); User permissions or RBAC configurations might also influence the visibility of datasets. Ensure that the API endpoints respect the user's permissions and roles. Recent changes in the
These updates might impact the dataset drop-down behavior in the RLS rule creation pop-up.
|
Bug description
When trying to create a new RLS rule, in the rule pop-up (check image for reference), there is the drop-down field for datasets. If you start filling this pop-up through the dataset field (which would be natural since this the obligatory field), in my version of Superset (and since 3.0.0 tbh I already detected this), not all datasets registered in Superset are available in the drop-down menu.
Yet, if you rather start filling this pop-up through the role drop-down, then all the datasets will be visible.
How to reproduce the bug
Preconditions: have RBAC enabled in your Superset config.
3.1. If you set the role drop-down first, then all datasets will be available to the dataset drop-down.
Screenshots/recordings
No response
Superset version
4.0.1
Python version
3.10
Node version
I don't know
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: