Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion frontend/e2e/fullstack/controls.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ const SURFACES: Surface[] = [
always: { what: 'the page heading', locate: heading('systems.title') },
controls: [
{
// TODO: back to 'manage:systems' when canCreateSystems drops its
// owner-level gate. Until the updated images are out, partners
// create systems on the legacy my.
what: 'the create-system button',
requires: 'manage:systems',
requires: OWNER_LEVEL,
locate: button('systems.create_system'),
},
],
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/lib/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ export const canManageSystems = () => {
return loginStore.permissions.includes(MANAGE_SYSTEMS)
}

// TODO: drop the owner-level gate once the NS8 and NethSecurity images that
// register against the new my are released. Until then partners create
// systems on the legacy my, and only the Owner organization creates them here.
export const canCreateSystems = () => hasOwnerLevelAuthority() && canManageSystems()

export const canReadApplications = () => {
const loginStore = useLoginStore()
return loginStore.permissions.includes(READ_APPLICATIONS)
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/SystemsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
faFilePdf,
} from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { canManageSystems } from '@/lib/permissions'
import { canCreateSystems } from '@/lib/permissions'
import SystemsTable from '@/components/systems/SystemsTable.vue'
import { useSystems } from '@/queries/systems/systems'
import { useNotificationsStore } from '@/stores/notifications'
Expand Down Expand Up @@ -165,7 +165,7 @@ async function exportSystems(format: 'pdf' | 'csv') {
</NeDropdown>
<!-- create system -->
<NeButton
v-if="canManageSystems()"
v-if="canCreateSystems()"
kind="primary"
size="lg"
class="shrink-0"
Expand Down
Loading