File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
site/src/pages/ManagementSettingsPage Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export const canEditOrganization = (
28
28
permissions : AuthorizationResponse | undefined ,
29
29
) => {
30
30
return (
31
- permissions &&
31
+ permissions !== undefined &&
32
32
( permissions . editOrganization ||
33
33
permissions . editMembers ||
34
34
permissions . editGroups )
Original file line number Diff line number Diff line change @@ -38,13 +38,10 @@ export const Sidebar: FC = () => {
38
38
permissions : orgPermissionsQuery . data ?. [ org . id ] ,
39
39
} ;
40
40
} )
41
- // TypeScript is not able to infer whether permissions are defined from the
42
- // canEditOrganization call, so although redundant this helps figure it out.
43
- . filter (
44
- ( org ) : org is OrganizationWithPermissions =>
45
- org . permissions !== undefined ,
46
- )
47
- . filter ( ( org ) => {
41
+ // TypeScript is not able to infer whether permissions are defined on the
42
+ // object even if we explicitly check org.permissions here, so add the `is`
43
+ // here to help out (canEditOrganization does the actual check).
44
+ . filter ( ( org ) : org is OrganizationWithPermissions => {
48
45
return canEditOrganization ( org . permissions ) ;
49
46
} ) ;
50
47
You can’t perform that action at this time.
0 commit comments