8000 fix: fix permissions for workspace creation by jaaydenh · Pull Request #17241 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix: fix permissions for workspace creation #17241

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

Merged
merged 7 commits into from
Apr 3, 2025
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Revert "fix: get org id for permission check on template layout"
This reverts commit 0b13269.
  • Loading branch information
jaaydenh committed Apr 3, 2025
commit d1f7eb0f53c2c6b0a8351b13d3627a38343ed700
12 changes: 4 additions & 8 deletions site/src/pages/TemplatePage/TemplateLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Loader } from "components/Loader/Loader";
import { Margins } from "components/Margins/Margins";
import { TabLink, Tabs, TabsList } from "components/Tabs/Tabs";
import { useAuthenticated } from "contexts/auth/RequireAuth";
import { useDashboard } from "modules/dashboard/useDashboard";
import { workspacePermissionChecks } from "modules/permissions/workspaces";
import {
type FC,
Expand Down Expand Up @@ -78,18 +77,15 @@ export const TemplateLayout: FC<PropsWithChildren> = ({
const { user: me } = useAuthenticated();
const { organization: organizationName = "default", template: templateName } =
useParams() as { organization?: string; template: string };
const { organizations } = useDashboard();
const organization = organizations.find((o) => o.name === organizationName);
const { data, error, isLoading } = useQuery({
queryKey: ["template", templateName],
queryFn: () => fetchTemplate(organizationName, templateName),
});
const workspacePermissionsQuery = useQuery({
...checkAuthorization({
checks: workspacePermissionChecks(organization?.id ?? "", me.id),
const workspacePermissionsQuery = useQuery(
checkAuthorization({
checks: workspacePermissionChecks(organizationName, me.id),
}),
enabled: organization !== undefined,
});
);

const location = useLocation();
const paths = location.pathname.split("/");
Expand Down
0