Skip to content

Commit 828752f

Browse files
committed
system views
1 parent c9eaa65 commit 828752f

2 files changed

Lines changed: 58 additions & 1 deletion

File tree

src/lib/utils/roleChecker.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,14 @@ export const ROLE_REQUIREMENTS = {
228228
},
229229
],
230230

231+
updateSystemView: [
232+
{
233+
role: "CanUpdateSystemView",
234+
description: "Update system views",
235+
action: "update system views",
236+
},
237+
],
238+
231239
getViewPermissions: [
232240
{
233241
role: "CanGetViewPermissionsAtAllBanks",
@@ -314,3 +322,20 @@ export function getCreateSystemViewPageRoles(): RoleRequirement[] {
314322
...ROLE_REQUIREMENTS.getViewPermissions,
315323
];
316324
}
325+
326+
/**
327+
* Get role requirements for updating system views
328+
*/
329+
export function getUpdateSystemViewRoles(): RoleRequirement[] {
330+
return [...ROLE_REQUIREMENTS.updateSystemView];
331+
}
332+
333+
/**
334+
* Get role requirements for updating system views page (includes all needed roles)
335+
*/
336+
export function getUpdateSystemViewPageRoles(): RoleRequirement[] {
337+
return [
338+
...ROLE_REQUIREMENTS.updateSystemView,
339+
...ROLE_REQUIREMENTS.getViewPermissions,
340+
];
341+
}

src/routes/(protected)/account-access/system-views/[view_id]/+page.svelte

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@
172172
</div>
173173
</div>
174174
<div class="header-actions">
175+
<a
176+
href="/account-access/system-views/{view.view_id}/edit"
177+
class="btn-primary"
178+
>
179+
Update
180+
</a>
175181
<a href="/account-access/system-views" class="btn-secondary">
176182
<ArrowLeft size={16} />
177183
Back to Views
@@ -449,7 +455,33 @@
449455
.header-actions {
450456
display: flex;
451457
gap: 0.75rem;
452-
flex-shrink: 0;
458+
align-items: center;
459+
}
460+
461+
.btn-primary {
462+
display: inline-flex;
463+
align-items: center;
464+
gap: 0.5rem;
465+
padding: 0.5rem 1rem;
466+
background: #3b82f6;
467+
color: white;
468+
border-radius: 0.5rem;
469+
font-size: 0.875rem;
470+
font-weight: 500;
471+
text-decoration: none;
472+
transition: background 0.2s;
473+
}
474+
475+
.btn-primary:hover {
476+
background: #2563eb;
477+
}
478+
479+
:global([data-mode="dark"]) .btn-primary {
480+
background: #3b82f6;
481+
}
482+
483+
:global([data-mode="dark"]) .btn-primary:hover {
484+
background: #2563eb;
453485
}
454486
455487
.btn-secondary {

0 commit comments

Comments
 (0)