Skip to content

Disable Additional Roles in Selfcare #765

Answered by jonasnobile
kausik10 asked this question in Support
Discussion options

You must be logged in to vote

There should be MembershipsControl component in lib/tenant/forms/memberships-control.tsx. You can simply modify the condition to hide DropdownMenu when there is role selected.

Something like this:

export const MembershipsControl = ({ setMemberships, memberships, roles }: MembershipsControlProps) => {
	const remainingRoles = roles ? Object.keys(roles).filter(role => !memberships.some(it => it.role === role)) : []

	return (
		<div className="flex flex-col gap-4">
			{memberships.length < 2 ? <div>
				<DropdownMenu>
					<DropdownMenuTrigger asChild>
						<Button variant="outline" className="flex gap-2"><PlusIcon className="w-4 h-4"/>{dict.tenant.invite.addRole}</Button>
					</DropdownMe…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kausik10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants