Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rbac client side code #26694

Merged
merged 27 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e5d76e4
add current team check in permission class
zlwaterfield Dec 5, 2024
e70f8eb
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 5, 2024
8731fd5
Update UI snapshots for `chromium` (2)
github-actions[bot] Dec 5, 2024
193dc55
Comment out access control for a few resource types
zlwaterfield Dec 5, 2024
87976f8
default the restricted area scope
zlwaterfield Dec 5, 2024
5723341
consider template a local only notebook
zlwaterfield Dec 5, 2024
e2dd5cf
Update the supported resources
zlwaterfield Dec 5, 2024
7c1e2af
Only allow admins/owners to toggle 2FA
zlwaterfield Dec 5, 2024
46718dd
Add access control checks for changing roles
zlwaterfield Dec 5, 2024
e8e82a5
merge master in
zlwaterfield Dec 10, 2024
e39241b
Copy improvements for roles and access control
zlwaterfield Dec 10, 2024
a3b7edb
Move ff permissions to open side panel
zlwaterfield Dec 10, 2024
a5934cb
Update dashboard sharing to link to new access control
zlwaterfield Dec 10, 2024
e009365
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 10, 2024
12b7862
Update UI snapshots for `chromium` (2)
github-actions[bot] Dec 10, 2024
49bf36f
Fix up notebook share modal
zlwaterfield Dec 10, 2024
a6d7481
Update AccessControlObject.tsx
zlwaterfield Dec 10, 2024
8d8d7b4
Add default access controls
zlwaterfield Dec 10, 2024
66d4fd2
Remove unneeded comments
zlwaterfield Dec 11, 2024
99361a8
Put sidebar context back
zlwaterfield Dec 11, 2024
0c6c6de
Merge branch 'master' into zach/rbac/5
zlwaterfield Dec 11, 2024
327a166
Update fixtures for tests
zlwaterfield Dec 11, 2024
9be56e7
Add old org rbac redirect
zlwaterfield Dec 12, 2024
6e16b90
Update the ff message for new RBAC
zlwaterfield Dec 12, 2024
37959c6
Merge remote-tracking branch 'origin/master' into zach/rbac/5
zlwaterfield Dec 18, 2024
fe85274
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 18, 2024
a68f7dc
Update UI snapshots for `chromium` (2)
github-actions[bot] Dec 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cypress/fixtures/api/notebooks/notebook.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
"first_name": "Employee 427",
"email": "[email protected]",
"is_email_verified": null
}
},
"user_access_level": "editor"
}
3 changes: 2 additions & 1 deletion cypress/fixtures/api/notebooks/notebooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"first_name": "Employee 427",
"email": "[email protected]",
"is_email_verified": null
}
},
"user_access_level": "editor"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion frontend/src/layout/ErrorProjectUnavailable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useValues } from 'kea'
import { PageHeader } from 'lib/components/PageHeader'
import { useEffect, useState } from 'react'
import { CreateOrganizationModal } from 'scenes/organization/CreateOrganizationModal'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'

Expand All @@ -11,6 +12,7 @@ import { organizationLogic } from '../scenes/organizationLogic'
export function ErrorProjectUnavailable(): JSX.Element {
const { projectCreationForbiddenReason } = useValues(organizationLogic)
const { user } = useValues(userLogic)
const { currentTeam } = useValues(teamLogic)
const [options, setOptions] = useState<JSX.Element[]>([])

useEffect(() => {
Expand Down Expand Up @@ -45,7 +47,8 @@ export function ErrorProjectUnavailable(): JSX.Element {
<PageHeader />
{!user?.organization ? (
<CreateOrganizationModal isVisible inline />
) : user?.team && !user.organization?.teams.some((team) => team.id === user?.team?.id) ? (
) : (user?.team && !user.organization?.teams.some((team) => team.id === user?.team?.id || user.team)) ||
currentTeam?.user_access_level === 'none' ? (
<>
<h1>Project access has been removed</h1>
<p>
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/layout/navigation-3000/sidepanel/SidePanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './SidePanel.scss'

import { IconEllipsis, IconFeatures, IconGear, IconInfo, IconNotebook, IconSupport } from '@posthog/icons'
import { IconEllipsis, IconFeatures, IconGear, IconInfo, IconLock, IconNotebook, IconSupport } from '@posthog/icons'
import { LemonButton, LemonMenu, LemonMenuItems, LemonModal } from '@posthog/lemon-ui'
import clsx from 'clsx'
import { useActions, useValues } from 'kea'
Expand All @@ -16,6 +16,7 @@ import {
import { themeLogic } from '~/layout/navigation-3000/themeLogic'
import { SidePanelTab } from '~/types'

import { SidePanelAccessControl } from './panels/access_control/SidePanelAccessControl'
import { SidePanelActivation, SidePanelActivationIcon } from './panels/activation/SidePanelActivation'
import { SidePanelActivity, SidePanelActivityIcon } from './panels/activity/SidePanelActivity'
import { SidePanelDiscussion, SidePanelDiscussionIcon } from './panels/discussion/SidePanelDiscussion'
Expand Down Expand Up @@ -87,6 +88,11 @@ export const SIDE_PANEL_TABS: Record<
Content: SidePanelStatus,
noModalSupport: true,
},
[SidePanelTab.AccessControl]: {
label: 'Access control',
Icon: IconLock,
Content: SidePanelAccessControl,
},
}

const DEFAULT_WIDTH = 512
Expand Down
Loading
Loading