Skip to content

Commit

Permalink
Merge pull request #22 from georchestra/import-role
Browse files Browse the repository at this point in the history
Implement IMPORT role for datafeeder
  • Loading branch information
f-necas authored Feb 20, 2024
2 parents 4217e61 + 048ecf6 commit 8413c98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type KNOWN_ROLES =
| 'ROLE_GN_ADMIN'
| 'ROLE_EMAILPROXY'
| 'ROLE_ANONYMOUS'
| 'ROLE_IMPORT'

interface WhoAmIResponse {
GeorchestraUser: {
Expand Down Expand Up @@ -42,6 +43,7 @@ export interface AdminRoles {
catalog: boolean
catalogAdmin: boolean
viewer: boolean
import: boolean
}

export async function getUserDetails(): Promise<User> {
Expand Down Expand Up @@ -87,6 +89,7 @@ export function getAdminRoles(roles: KNOWN_ROLES[]): AdminRoles | null {
catalog,
catalogAdmin,
viewer,
import: superUser || roles.indexOf('ROLE_IMPORT') > -1,
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/header.ce.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ onMounted(() => {
>{{ t('services') }}</a
>
<a
v-if="!isAnonymous"
v-if="adminRoles?.import"
class="nav-item"
href="/import/"
:class="{ active: props.activeApp === 'import' }"
Expand Down

0 comments on commit 8413c98

Please sign in to comment.