@@ -191,7 +191,6 @@ const useTabs = ({
191191 const { data : user } = trpc . viewer . me . get . useQuery ( { includePasswordAdded : true } ) ;
192192 const orgBranding = useOrgBranding ( ) ;
193193 const isAdmin = session . data ?. user . role === UserPermissionRole . ADMIN ;
194- const isOrgAdminOrOwner = checkAdminOrOwner ( orgBranding ?. role ) ;
195194
196195 const processTabsMemod = useMemo ( ( ) => {
197196 const processedTabs = getTabs ( orgBranding ) . map ( ( tab ) => {
@@ -204,13 +203,10 @@ const useTabs = ({
204203 } ;
205204 } else if ( tab . href === "/settings/organizations" ) {
206205 const newArray = ( tab ?. children ?? [ ] ) . filter (
207- ( child ) =>
208- permissions ?. canUpdateOrganization ||
209- isOrgAdminOrOwner ||
210- ! organizationAdminKeys . includes ( child . name )
206+ ( child ) => permissions ?. canUpdateOrganization || ! organizationAdminKeys . includes ( child . name )
211207 ) ;
212208
213- if ( permissions ?. canUpdateOrganization || isOrgAdminOrOwner ) {
209+ if ( permissions ?. canUpdateOrganization ) {
214210 newArray . splice ( 4 , 0 , {
215211 name : "attributes" ,
216212 href : "/settings/organizations/attributes" ,
@@ -242,7 +238,7 @@ const useTabs = ({
242238 } ) ;
243239 }
244240 } else {
245- if ( permissions ?. canUpdateOrganization || isOrgAdminOrOwner ) {
241+ if ( permissions ?. canUpdateOrganization ) {
246242 newArray . push ( {
247243 name : "billing" ,
248244 href : "/settings/organizations/billing" ,
@@ -268,8 +264,7 @@ const useTabs = ({
268264 return { ...tab , children : filtered } ;
269265 } else if ( tab . href === "/settings/developer" ) {
270266 const filtered = tab ?. children ?. filter (
271- ( childTab ) =>
272- permissions ?. canUpdateOrganization || isOrgAdminOrOwner || childTab . name !== "admin_api"
267+ ( childTab ) => permissions ?. canUpdateOrganization || childTab . name !== "admin_api"
273268 ) ;
274269 return { ...tab , children : filtered } ;
275270 }
@@ -279,21 +274,12 @@ const useTabs = ({
279274 // check if name is in adminRequiredKeys
280275 return processedTabs . filter ( ( tab ) => {
281276 if ( organizationRequiredKeys . includes ( tab . name ) ) return ! ! orgBranding ;
282- if ( tab . name === "other_teams" && ! ( permissions ?. canUpdateOrganization || isOrgAdminOrOwner ) )
283- return false ;
277+ if ( tab . name === "other_teams" && ! permissions ?. canUpdateOrganization ) return false ;
284278
285279 if ( isAdmin ) return true ;
286280 return ! adminRequiredKeys . includes ( tab . name ) ;
287281 } ) ;
288- } , [
289- isAdmin ,
290- orgBranding ,
291- isOrgAdminOrOwner ,
292- user ,
293- isDelegationCredentialEnabled ,
294- isPbacEnabled ,
295- permissions ,
296- ] ) ;
282+ } , [ isAdmin , orgBranding , user , isDelegationCredentialEnabled , isPbacEnabled , permissions ] ) ;
297283
298284 return processTabsMemod ;
299285} ;
@@ -574,8 +560,6 @@ const SettingsSidebarContainer = ({
574560 }
575561 } , [ searchParams ?. get ( "id" ) , otherTeams ] ) ;
576562
577- const isOrgAdminOrOwner = checkAdminOrOwner ( orgBranding ?. role ) ;
578-
579563 return (
580564 < nav
581565 style = { { maxHeight : `calc(100vh - ${ bannersHeight } px)` , top : `${ bannersHeight } px` } }
@@ -652,12 +636,12 @@ const SettingsSidebarContainer = ({
652636 as = "p"
653637 className = "text-subtle truncate text-sm font-medium leading-5"
654638 loadingClassName = "ms-3" >
655- { t ( isOrgAdminOrOwner ? "my_teams" : tab . name ) }
639+ { t ( "my_teams" ) }
656640 </ Skeleton >
657641 </ div >
658642 </ Link >
659643 < TeamListCollapsible teamFeatures = { teamFeatures } />
660- { ( ! orgBranding ?. id || permissions ?. canUpdateOrganization || isOrgAdminOrOwner ) && (
644+ { ( ! orgBranding ?. id || permissions ?. canUpdateOrganization ) && (
661645 < VerticalTabItem
662646 name = { t ( "add_a_team" ) }
663647 href = { `${ WEBAPP_URL } /settings/teams/new` }
0 commit comments