diff --git a/src/hooks.server.ts b/src/hooks.server.ts
index 02dcc9c7..b13b5402 100644
--- a/src/hooks.server.ts
+++ b/src/hooks.server.ts
@@ -1,5 +1,6 @@
import type { Handle } from '@sveltejs/kit';
-import { authService, canAccessAdminArea, ensureAuthReady } from './modules/auth';
+import { authService, cancanService, ensureAuthReady } from './modules/auth';
+import { ensureOrganizationReady, organizationService } from './modules/organization';
import { getGitDb } from '$lib/server/gitdb';
getGitDb();
@@ -10,6 +11,8 @@ export const handle: Handle = async ({ event, resolve }) => {
}
await ensureAuthReady();
+ await ensureOrganizationReady();
+
const sessionCookie = event.cookies.get('pos_session');
const currentUser = await authService.resolveAuthenticatedUser(sessionCookie);
@@ -22,8 +25,18 @@ export const handle: Handle = async ({ event, resolve }) => {
return new Response(null, { status: 302, headers: { location: '/login' } });
}
- if (event.url.pathname.startsWith('/settings') || event.url.pathname.startsWith('/api/system')) {
- if (!canAccessAdminArea(currentUser)) {
+ const organizationSettingsMatch = event.url.pathname.match(/^\/org\/([^/]+)\/settings/);
+ if (organizationSettingsMatch) {
+ const organization = await organizationService.tryFindBySlug(organizationSettingsMatch[1]);
+ if (!organization || !(await cancanService.canManageOrganization(currentUser, organization.id))) {
+ return new Response(null, { status: 302, headers: { location: '/' } });
+ }
+ } else if (
+ event.url.pathname.startsWith('/cluster-settings') ||
+ event.url.pathname.startsWith('/api/system') ||
+ event.url.pathname.startsWith('/api/organizations')
+ ) {
+ if (!cancanService.canAccessAdminArea(currentUser)) {
return new Response(null, { status: 302, headers: { location: '/' } });
}
}
diff --git a/src/lib/components/AppNavbar.svelte b/src/lib/components/AppNavbar.svelte
index ba31a4ba..1659b32a 100644
--- a/src/lib/components/AppNavbar.svelte
+++ b/src/lib/components/AppNavbar.svelte
@@ -1,12 +1,12 @@
+
+
| Resource | +Permission | +
|---|---|
|
+
+ {#if hasExpandableContent(permissionRow)}
+
+ {:else}
+
+ {/if}
+
+ {rowLabel(permissionRow)}
+
+
+ |
+ + {#if permissionRow.permissions.length} + {#key `${permissionRow.key}:${accessLevel(permissionRow)}`} + + {/key} + {:else} + Section group + {/if} + | +
|
+
+ {#each visibleRowPermissions(permissionRow) as permission}
+ {@const action = actionFrom(permission)}
+ {#key `${permission}:${selectedPermissionsKey}`}
+
+ {/key}
+ {/each}
+
+ |
+ |
{description}
+| Name | +Slug | +
|---|---|
|
+
+ |
+ + {role.slug} + | +
{description}
++ {users.length === 0 ? 'No users found.' : 'No users match your search.'} +
+| User | +Organizations | + {/if} +Role | +Status | +Added | +Actions | +|
|---|---|---|---|---|---|---|
| {user.username} | +{user.email || '-'} | + {#if scope === 'cluster'} +
+ {#if user.organizations?.length}
+
+ {#each user.organizations as organization (organization.id)}
+
+ {organization.name}
+ {#if organization.role}
+ ·
+ {organization.role}
+ {/if}
+
+ {/each}
+
+ {:else}
+ -
+ {/if}
+ |
+ {/if}
+
+
+
+ {#if openRoleMenuId === user.id}
+
+
+ {#each roles as role (role.id)}
+
+ {/each}
+
+ {/if}
+ |
+ + + + {user.status === 'invited' ? 'Invited' : 'Active'} + + | +{formatDate(user.createdAt)} | +
+
+ {#if user.status === 'invited'}
+
+ {/if}
+
+
+ |
+
+ Remove access for {removeModalUser.username}? This will revoke this scope assignment. +
+Create, view and manage cluster organizations.
+| Name | +Slug | +Created | +Actions | +
|---|---|---|---|
|
+
+
+
+
+ {organization.name} + {#if organization.description} +{organization.description} + {/if} + |
+ {organization.slug} | +{formatDate(organization.createdAt)} | +
+
+
+
+ |
+
+ Are you sure you want to delete {deleteModalOrganization.name}? This action cannot be undone. +
+Delete organization
++ Permanently deletes this organization. This action cannot be undone. +
++ Are you sure you want to delete {organization.name}? This action cannot be undone. +
+Choose an organization to continue.
+{organization.name}
+{organization.slug}
+ {#if organization.description} +{organization.description}
+ {/if} +Define roles y permisos específicos por proyecto.
-Próximamente
-- Los roles y permisos por proyecto todavía no están disponibles. -
-- Gestiona qué usuarios y grupos tienen acceso a cada proyecto. -
-Próximamente
-- La gestión de usuarios y grupos por proyecto todavía no está disponible. -
-+ Configure organization-wide authentication methods and security defaults. +
++ Local login is always enabled. Optionally connect GCP Workspace and SAML as additional + providers. +
+Local authentication: always ON
++ Username/password access remains available even when external providers are enabled. +
++ Allow users to authenticate with Google Workspace accounts. +
++ Connect an enterprise identity provider through SAML. +
++ Organization encryption controls will be managed here. +
+Coming soon
++ Key rotation, encryption policy, and scoped secret protection settings are planned for a + future release. +
+