feat: restrict non credential provider interactions (#871)
* wip: add provider field to sqlite user table * feat: disable invites when credentials provider is not used * wip: add migration for provider field in user table with sqlite * wip: remove fields that can not be modified by non credential users * wip: make username, mail and avatar disabled instead of hidden * wip: external users membership of group cannot be managed manually * feat: add alerts to inform about disabled fields and managing group members * wip: add mysql migration for provider on user table * chore: fix format issues * chore: address pull request feedback * fix: build issue * fix: deepsource issues * fix: tests not working * feat: restrict login to specific auth providers * chore: address pull request feedback * fix: deepsource issue
This commit is contained in:
@@ -22,18 +22,24 @@ export const MainNavigation = ({ headerSection, footerSection, links }: MainNavi
|
||||
component={ScrollArea}
|
||||
>
|
||||
{links.map((link, index) => {
|
||||
if (link.hidden) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { icon: TablerIcon, ...props } = link;
|
||||
const Icon = <TablerIcon size={20} stroke={1.5} />;
|
||||
let clientLink: ClientNavigationLink;
|
||||
if ("items" in props) {
|
||||
clientLink = {
|
||||
...props,
|
||||
items: props.items.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
icon: <item.icon size={20} stroke={1.5} />,
|
||||
};
|
||||
}),
|
||||
items: props.items
|
||||
.filter((item) => !item.hidden)
|
||||
.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
icon: <item.icon size={20} stroke={1.5} />,
|
||||
};
|
||||
}),
|
||||
} as ClientNavigationLink;
|
||||
} else {
|
||||
clientLink = props as ClientNavigationLink;
|
||||
@@ -49,6 +55,7 @@ export const MainNavigation = ({ headerSection, footerSection, links }: MainNavi
|
||||
interface CommonNavigationLinkProps {
|
||||
label: string;
|
||||
icon: TablerIcon;
|
||||
hidden?: boolean;
|
||||
}
|
||||
|
||||
interface NavigationLinkHref extends CommonNavigationLinkProps {
|
||||
|
||||
Reference in New Issue
Block a user