- Notifications
You must be signed in to change notification settings - Fork928
feat: add organization-scoped permission checks to deployment settings#14063
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
20 commits Select commitHold shift + click to select a range
07abd01
s/readAllUsers/viewAllUsers
code-asherbd52bec
Check license for organizations
code-asher2779677
Allow any auditor to view the audit log
code-ashere0a933e
Scope create group button to organizations
code-asher6dba321
Use fine-grained permissions on settings page
code-asher69c50ec
Dedupe disable org permission query
code-asher2a8c38b
Fix edit org member check
code-asher9fdd425
Show better message when unable to edit anything in an org
code-asher8760d0b
Update org member tests
code-asher5ad80b9
Add stories for organization members page
code-ashera370037
Add stories for multi-org sidebar
code-ashera3698d8
Remove multi-org check from management settings layout
code-asher185f2c0
Check for license permission
code-asherd7afcfc
Add more stories for deployment dropdown
code-asher12e5a42
Throw error if no default org
code-asher4a7c9d9
Merge branch 'main' into asher/org-permissions
code-asher55a2d47
Use default org ID in old pages
code-ashere58b032
Remove org permission-based redirects
code-asher0b4b00b
Use old permission for old pages
code-asher5a547fc
Show ineditable form without org edit perm
code-asherFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
61 changes: 61 additions & 0 deletionssite/src/api/queries/organizations.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
54 changes: 46 additions & 8 deletionssite/src/contexts/auth/permissions.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletionssite/src/modules/dashboard/Navbar/Navbar.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
44 changes: 41 additions & 3 deletionssite/src/modules/dashboard/Navbar/NavbarView.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletionssite/src/pages/AuditPage/AuditPage.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
31 changes: 15 additions & 16 deletionssite/src/pages/DeploySettingsPage/DeploySettingsLayout.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -9,11 +9,12 @@ import { Stack } from "components/Stack/Stack"; | ||
import { useAuthenticated } from "contexts/auth/RequireAuth"; | ||
import { RequirePermission } from "contexts/auth/RequirePermission"; | ||
import { useDashboard } from "modules/dashboard/useDashboard"; | ||
import { useFeatureVisibility } from "modules/dashboard/useFeatureVisibility"; | ||
import { ManagementSettingsLayout } from "pages/ManagementSettingsPage/ManagementSettingsLayout"; | ||
import { Sidebar } from "./Sidebar"; | ||
type DeploySettingsContextValue = { | ||
deploymentValues: DeploymentConfig | undefined; | ||
}; | ||
export const DeploySettingsContext = createContext< | ||
@@ -33,9 +34,11 @@ export const useDeploySettings = (): DeploySettingsContextValue => { | ||
export const DeploySettingsLayout: FC = () => { | ||
const { experiments } = useDashboard(); | ||
const feats = useFeatureVisibility(); | ||
const canViewOrganizations = | ||
feats.multiple_organizations && experiments.includes("multi-organization"); | ||
returncanViewOrganizations ? ( | ||
<ManagementSettingsLayout /> | ||
) : ( | ||
<DeploySettingsLayoutInner /> | ||
@@ -52,19 +55,15 @@ const DeploySettingsLayoutInner: FC = () => { | ||
<Stack css={{ padding: "48px 0" }} direction="row" spacing={6}> | ||
<Sidebar /> | ||
<main css={{ maxWidth: 800, width: "100%" }}> | ||
<DeploySettingsContext.Provider | ||
BrunoQuaresma marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
value={{ | ||
deploymentValues: deploymentConfigQuery.data, | ||
}} | ||
> | ||
<Suspense fallback={<Loader />}> | ||
<Outlet /> | ||
</Suspense> | ||
</DeploySettingsContext.Provider> | ||
</main> | ||
</Stack> | ||
</Margins> | ||
7 changes: 6 additions & 1 deletionsite/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPage.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.