File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
pages/ManagementSettingsPage Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,13 @@ export const organizationPermissions = (organizationId: string | undefined) => {
177
177
} ,
178
178
action : "read" ,
179
179
} ,
180
+ assignOrgRole : {
181
+ object : {
182
+ resource_type : "assign_org_role" ,
183
+ organization_id : organizationId ,
184
+ } ,
185
+ action : "create" ,
186
+ } ,
180
187
} ,
181
188
} ) ,
182
189
} ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { Sidebar as BaseSidebar } from "components/Sidebar/Sidebar";
10
10
import { Stack } from "components/Stack/Stack" ;
11
11
import { UserAvatar } from "components/UserAvatar/UserAvatar" ;
12
12
import { type ClassName , useClassName } from "hooks/useClassName" ;
13
+ import { useDashboard } from "modules/dashboard/useDashboard" ;
13
14
import { linkToAuditing , linkToUsers , withFilter } from "modules/navigation" ;
14
15
15
16
interface SidebarProps {
@@ -184,6 +185,8 @@ interface OrganizationSettingsNavigationProps {
184
185
const OrganizationSettingsNavigation : FC <
185
186
OrganizationSettingsNavigationProps
186
187
> = ( props ) => {
188
+ const { experiments } = useDashboard ( ) ;
189
+
187
190
return (
188
191
< >
189
192
< SidebarNavItem
@@ -225,6 +228,14 @@ const OrganizationSettingsNavigation: FC<
225
228
Groups
226
229
</ SidebarNavSubItem >
227
230
) }
231
+ { props . permissions . assignOrgRole &&
232
+ experiments . includes ( "custom-roles" ) && (
233
+ < SidebarNavSubItem
234
+ href = { urlForSubpage ( props . organization . name , "roles" ) }
235
+ >
236
+ Roles
237
+ </ SidebarNavSubItem >
238
+ ) }
228
239
{ /* For now redirect to the site-wide audit page with the organization
229
240
pre-filled into the filter. Based on user feedback we might want
230
241
to serve a copy of the audit page or even delete this link. */ }
You can’t perform that action at this time.
0 commit comments