Skip to content

Commit ba22bc9

Browse files
committed
fixup! Merge remote-tracking branch 'github/main' into asher/show-editable-orgs
1 parent 9aca231 commit ba22bc9

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

site/src/api/queries/organizations.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ export const organizationsPermissions = (
185185
queryKey: ["organizations", organizationIds.sort(), "permissions"],
186186
queryFn: async () => {
187187
// Only request what we need for the sidebar, which is one edit permission
188-
// per sub-link (audit page, settings page, groups page, and members page)
189-
// that tells us whether to show that page, since we only show them if you
190-
// can edit (and not, at the moment if you can only view).
188+
// per sub-link (audit, settings, groups, roles, and members pages) that
189+
// tells us whether to show that page, since we only show them if you can
190+
// edit (and not, at the moment if you can only view).
191191
const checks = (organizationId: string) => ({
192192
editMembers: {
193193
object: {
@@ -217,6 +217,13 @@ export const organizationsPermissions = (
217217
},
218218
action: "read",
219219
},
220+
assignOrgRole: {
221+
object: {
222+
resource_type: "assign_org_role",
223+
organization_id: organizationId,
224+
},
225+
action: "create",
226+
},
220227
});
221228

222229
// The endpoint takes a flat array, so to avoid collisions prepend each

site/src/pages/ManagementSettingsPage/SidebarView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ const OrganizationSettingsNavigation: FC<
256256
Groups
257257
</SidebarNavSubItem>
258258
)}
259-
{props.permissions.assignOrgRole &&
259+
{organization.permissions.assignOrgRole &&
260260
experiments.includes("custom-roles") && (
261261
<SidebarNavSubItem
262-
href={urlForSubpage(props.organization.name, "roles")}
262+
href={urlForSubpage(organization.name, "roles")}
263263
>
264264
Roles
265265
</SidebarNavSubItem>

0 commit comments

Comments
 (0)