Skip to content

Commit

Permalink
fix(clerk-js): Update to new permission names
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef committed Oct 13, 2023
1 parent b6abe36 commit 7746694
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,6 @@ export const DomainList = withGate(
);
},
{
permission: 'org:domains:manage',
permission: 'org:sys_domains:manage',
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const OrganizationProfileRoutes = (props: PropsOfComponent<typeof Profile
flowStart
>
<Gate
permission={'org:profile:manage'}
permission={'org:sys_profile:manage'}
redirectTo='../'
>
<ProfileSettingsPage />
Expand All @@ -35,31 +35,31 @@ export const OrganizationProfileRoutes = (props: PropsOfComponent<typeof Profile
<Switch>
<Route path=':id/verify'>
<Gate
permission={'org:domains:manage'}
permission={'org:sys_domains:manage'}
redirectTo='../../'
>
<VerifyDomainPage />
</Gate>
</Route>
<Route path=':id/remove'>
<Gate
permission={'org:domains:delete'}
permission={'org:sys_domains:delete'}
redirectTo='../../'
>
<RemoveDomainPage />
</Gate>
</Route>
<Route path=':id'>
<Gate
permission={'org:domains:manage'}
permission={'org:sys_domains:manage'}
redirectTo='../../'
>
<VerifiedDomainPage />
</Gate>
</Route>
<Route index>
<Gate
permission={'org:domains:manage'}
permission={'org:sys_domains:manage'}
redirectTo='../'
>
<AddDomainPage />
Expand All @@ -78,7 +78,7 @@ export const OrganizationProfileRoutes = (props: PropsOfComponent<typeof Profile
flowStart
>
<Gate
permission={'org:profile:delete'}
permission={'org:sys_profile:delete'}
redirectTo='../'
>
<DeleteOrganizationPage />
Expand All @@ -96,7 +96,7 @@ export const OrganizationProfileRoutes = (props: PropsOfComponent<typeof Profile
flowStart
>
<Gate
permission={'org:memberships:manage'}
permission={'org:sys_memberships:manage'}
redirectTo='../'
>
<InviteMembersPage />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const OrganizationSettings = () => {
<Header.Subtitle localizationKey={localizationKeys('organizationProfile.start.headerSubtitle__settings')} />
</Header.Root>
<OrganizationProfileSection />
<Gate permission='org:domains:manage'>
<Gate permission='org:sys_domains:manage'>
<OrganizationDomainsSection />
</Gate>
<OrganizationDangerSection />
Expand Down Expand Up @@ -56,7 +56,7 @@ const OrganizationProfileSection = () => {
id='organizationProfile'
>
<Gate
permission={'org:profile:manage'}
permission={'org:sys_profile:manage'}
fallback={<>{profile}</>}
>
<BlockButton onClick={() => navigate('profile')}>{profile}</BlockButton>
Expand Down Expand Up @@ -104,7 +104,7 @@ const OrganizationDangerSection = () => {
},
});
const { navigate } = useRouter();
const { isAuthorizedUser: canDeleteOrganization } = useGate({ permission: 'org:profile:delete' });
const { isAuthorizedUser: canDeleteOrganization } = useGate({ permission: 'org:sys_profile:delete' });

if (!organization) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ describe('OrganizationMembers', () => {
expect(queryByText('Member')).toBeInTheDocument();
});

// TODO: remove skip once OrganizationMembers uses permission based checks
it.skip('changes tab and renders pending requests', async () => {
it('changes tab and renders pending requests', async () => {
const requests = {
data: [
createFakeOrganizationMembershipRequest({
Expand Down

0 comments on commit 7746694

Please sign in to comment.