diff --git a/packages/client-ui/config/layout/contants.ts b/packages/client-ui/config/layout/contants.ts index ea5938280..c8c155962 100644 --- a/packages/client-ui/config/layout/contants.ts +++ b/packages/client-ui/config/layout/contants.ts @@ -6,7 +6,8 @@ */ import type { NavigationItem } from '@vuecs/navigation'; -import { PermissionID } from '@privateaim/core-kit'; +import { PermissionName } from '@privateaim/kit'; +import { PermissionName as AuthupPermissionName } from '@authup/core-kit'; export enum LayoutKey { NAVIGATION_ID = 'navigationId', @@ -55,19 +56,19 @@ export const LayoutSideDefaultNavigation: NavigationItem[] = [ icon: 'fas fa-tasks', [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionID.PROJECT_ADD, - PermissionID.PROJECT_DROP, - PermissionID.PROJECT_EDIT, - PermissionID.PROJECT_APPROVE, + PermissionName.PROJECT_CREATE, + PermissionName.PROJECT_DELETE, + PermissionName.PROJECT_UPDATE, + PermissionName.PROJECT_APPROVE, - PermissionID.ANALYSIS_ADD, - PermissionID.ANALYSIS_DROP, - PermissionID.ANALYSIS_EDIT, - PermissionID.ANALYSIS_APPROVE, + PermissionName.ANALYSIS_CREATE, + PermissionName.ANALYSIS_DELETE, + PermissionName.ANALYSIS_UPDATE, + PermissionName.ANALYSIS_APPROVE, - PermissionID.ANALYSIS_RESULT_READ, - PermissionID.ANALYSIS_EXECUTION_START, - PermissionID.ANALYSIS_EXECUTION_STOP, + PermissionName.ANALYSIS_RESULT_READ, + PermissionName.ANALYSIS_EXECUTION_START, + PermissionName.ANALYSIS_EXECUTION_STOP, ], }, { @@ -77,13 +78,13 @@ export const LayoutSideDefaultNavigation: NavigationItem[] = [ icon: 'fa fa-bar-chart', requireLoggedIn: true, requirePermissions: [ - PermissionID.ANALYSIS_ADD, - PermissionID.ANALYSIS_DROP, - PermissionID.ANALYSIS_EDIT, - PermissionID.ANALYSIS_APPROVE, + PermissionName.ANALYSIS_CREATE, + PermissionName.ANALYSIS_DELETE, + PermissionName.ANALYSIS_UPDATE, + PermissionName.ANALYSIS_APPROVE, - PermissionID.ANALYSIS_EXECUTION_START, - PermissionID.ANALYSIS_EXECUTION_STOP, + PermissionName.ANALYSIS_EXECUTION_START, + PermissionName.ANALYSIS_EXECUTION_STOP, ], }, { @@ -112,27 +113,27 @@ export const LayoutSideAdminNavigation: NavigationItem[] = [ icon: 'fas fa-lock', [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionID.REALM_ADD, - PermissionID.REALM_EDIT, - PermissionID.REALM_DROP, + AuthupPermissionName.REALM_CREATE, + AuthupPermissionName.REALM_UPDATE, + AuthupPermissionName.REALM_DELETE, - PermissionID.PROVIDER_ADD, - PermissionID.PROVIDER_EDIT, - PermissionID.PROVIDER_DROP, + AuthupPermissionName.IDENTITY_PROVIDER_CREATE, + AuthupPermissionName.IDENTITY_PROVIDER_UPDATE, + AuthupPermissionName.IDENTITY_PROVIDER_DELETE, - PermissionID.USER_ADD, - PermissionID.USER_EDIT, - PermissionID.USER_DROP, + AuthupPermissionName.USER_CREATE, + AuthupPermissionName.USER_UPDATE, + AuthupPermissionName.USER_DELETE, - PermissionID.ROLE_ADD, - PermissionID.ROLE_EDIT, - PermissionID.ROLE_DROP, - PermissionID.ROLE_PERMISSION_ADD, - PermissionID.ROLE_PERMISSION_DROP, + AuthupPermissionName.ROLE_CREATE, + AuthupPermissionName.ROLE_UPDATE, + AuthupPermissionName.ROLE_DELETE, + AuthupPermissionName.ROLE_PERMISSION_CREATE, + AuthupPermissionName.ROLE_PERMISSION_DELETE, - PermissionID.PERMISSION_ADD, - PermissionID.PERMISSION_EDIT, - PermissionID.PERMISSION_DROP, + AuthupPermissionName.PERMISSION_CREATE, + AuthupPermissionName.PERMISSION_UPDATE, + AuthupPermissionName.PERMISSION_DELETE, ], children: [ { @@ -142,13 +143,13 @@ export const LayoutSideAdminNavigation: NavigationItem[] = [ icon: 'fas fa-university', [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionID.REALM_ADD, - PermissionID.REALM_EDIT, - PermissionID.REALM_DROP, + AuthupPermissionName.REALM_CREATE, + AuthupPermissionName.REALM_UPDATE, + AuthupPermissionName.REALM_DELETE, - PermissionID.PROVIDER_ADD, - PermissionID.PROVIDER_DROP, - PermissionID.PROJECT_EDIT, + AuthupPermissionName.IDENTITY_PROVIDER_CREATE, + AuthupPermissionName.IDENTITY_PROVIDER_DELETE, + PermissionName.PROJECT_UPDATE, ], }, { @@ -158,9 +159,9 @@ export const LayoutSideAdminNavigation: NavigationItem[] = [ icon: 'fas fa-atom', [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionID.PROVIDER_ADD, - PermissionID.PROVIDER_EDIT, - PermissionID.PROVIDER_DROP, + AuthupPermissionName.IDENTITY_PROVIDER_CREATE, + AuthupPermissionName.IDENTITY_PROVIDER_UPDATE, + AuthupPermissionName.IDENTITY_PROVIDER_DELETE, ], }, { @@ -170,9 +171,9 @@ export const LayoutSideAdminNavigation: NavigationItem[] = [ icon: 'fas fa-robot', [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionID.ROBOT_ADD, - PermissionID.ROBOT_EDIT, - PermissionID.ROBOT_DROP, + AuthupPermissionName.ROBOT_CREATE, + AuthupPermissionName.ROBOT_UPDATE, + AuthupPermissionName.ROBOT_DELETE, ], }, { @@ -182,9 +183,9 @@ export const LayoutSideAdminNavigation: NavigationItem[] = [ icon: 'fas fa-user', [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionID.USER_ADD, - PermissionID.USER_EDIT, - PermissionID.USER_DROP, + AuthupPermissionName.USER_CREATE, + AuthupPermissionName.USER_UPDATE, + AuthupPermissionName.USER_DELETE, ], }, { @@ -194,12 +195,12 @@ export const LayoutSideAdminNavigation: NavigationItem[] = [ icon: 'fas fa-users', [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionID.ROLE_ADD, - PermissionID.ROLE_EDIT, - PermissionID.ROLE_DROP, + AuthupPermissionName.ROLE_CREATE, + AuthupPermissionName.ROLE_UPDATE, + AuthupPermissionName.ROLE_DELETE, - PermissionID.ROLE_PERMISSION_ADD, - PermissionID.ROLE_PERMISSION_DROP, + AuthupPermissionName.ROLE_PERMISSION_CREATE, + AuthupPermissionName.ROLE_PERMISSION_DELETE, ], }, { @@ -209,9 +210,9 @@ export const LayoutSideAdminNavigation: NavigationItem[] = [ icon: 'fas fa-key', [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionID.PERMISSION_ADD, - PermissionID.PERMISSION_EDIT, - PermissionID.PERMISSION_DROP, + AuthupPermissionName.PERMISSION_CREATE, + AuthupPermissionName.PERMISSION_UPDATE, + AuthupPermissionName.PERMISSION_DELETE, ], }, ], @@ -222,11 +223,11 @@ export const LayoutSideAdminNavigation: NavigationItem[] = [ icon: 'fas fa-globe', [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionID.NODE_ADD, - PermissionID.NODE_DROP, - PermissionID.NODE_EDIT, + PermissionName.NODE_CREATE, + PermissionName.NODE_DELETE, + PermissionName.NODE_UPDATE, - PermissionID.SERVICE_MANAGE, + PermissionName.SERVICE_MANAGE, ], children: [ { @@ -236,9 +237,9 @@ export const LayoutSideAdminNavigation: NavigationItem[] = [ icon: 'fa-solid fa-server', [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionID.NODE_ADD, - PermissionID.NODE_DROP, - PermissionID.NODE_EDIT, + PermissionName.NODE_CREATE, + PermissionName.NODE_DELETE, + PermissionName.NODE_UPDATE, ], }, { @@ -248,7 +249,7 @@ export const LayoutSideAdminNavigation: NavigationItem[] = [ icon: 'fa fa-map-signs', [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionID.SERVICE_MANAGE, + PermissionName.SERVICE_MANAGE, ], }, ], diff --git a/packages/client-ui/pages/admin/identity-providers/[id].vue b/packages/client-ui/pages/admin/identity-providers/[id].vue index 47d4be5f9..51d9144d1 100644 --- a/packages/client-ui/pages/admin/identity-providers/[id].vue +++ b/packages/client-ui/pages/admin/identity-providers/[id].vue @@ -29,7 +29,8 @@ export default defineNuxtComponent({ [LayoutKey.NAVIGATION_ID]: LayoutNavigationID.ADMIN, [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionName.REALM_EDIT, + PermissionName.IDENTITY_PROVIDER_UPDATE, + PermissionName.IDENTITY_PROVIDER_READ, ], }); diff --git a/packages/client-ui/pages/admin/identity-providers/[id]/index.vue b/packages/client-ui/pages/admin/identity-providers/[id]/index.vue index 0266e36fd..50776c8ad 100644 --- a/packages/client-ui/pages/admin/identity-providers/[id]/index.vue +++ b/packages/client-ui/pages/admin/identity-providers/[id]/index.vue @@ -29,7 +29,7 @@ export default defineNuxtComponent({ definePageMeta({ [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionName.REALM_EDIT, + PermissionName.IDENTITY_PROVIDER_UPDATE, ], }); diff --git a/packages/client-ui/pages/admin/identity-providers/index.vue b/packages/client-ui/pages/admin/identity-providers/index.vue index 2664fd3fe..586d41918 100644 --- a/packages/client-ui/pages/admin/identity-providers/index.vue +++ b/packages/client-ui/pages/admin/identity-providers/index.vue @@ -19,9 +19,10 @@ export default defineNuxtComponent({ [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.NAVIGATION_ID]: LayoutNavigationID.ADMIN, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionName.PROVIDER_EDIT, - PermissionName.PROVIDER_DROP, - PermissionName.PROVIDER_ADD, + PermissionName.IDENTITY_PROVIDER_UPDATE, + PermissionName.IDENTITY_PROVIDER_DELETE, + PermissionName.IDENTITY_PROVIDER_CREATE, + PermissionName.IDENTITY_PROVIDER_READ, ], }); diff --git a/packages/client-ui/pages/admin/identity-providers/index/add.vue b/packages/client-ui/pages/admin/identity-providers/index/add.vue index bd204542f..3aea3d15e 100644 --- a/packages/client-ui/pages/admin/identity-providers/index/add.vue +++ b/packages/client-ui/pages/admin/identity-providers/index/add.vue @@ -27,7 +27,7 @@ export default defineNuxtComponent({ [LayoutKey.NAVIGATION_ID]: LayoutNavigationID.ADMIN, [LayoutKey.REQUIRED_LOGGED_IN]: true, [LayoutKey.REQUIRED_PERMISSIONS]: [ - PermissionName.REALM_ADD, + PermissionName.IDENTITY_PROVIDER_CREATE, ], }); diff --git a/packages/client-ui/pages/admin/identity-providers/index/index.vue b/packages/client-ui/pages/admin/identity-providers/index/index.vue index 911799f6c..f2214ce31 100644 --- a/packages/client-ui/pages/admin/identity-providers/index/index.vue +++ b/packages/client-ui/pages/admin/identity-providers/index/index.vue @@ -46,8 +46,8 @@ export default defineNuxtComponent({ resource: IdentityProvider, ) => isRealmResourceWritable(realm.value, resource.realm_id); - const hasEditPermission = useAbilityCheck(PermissionName.PROVIDER_EDIT); - const hasDropPermission = useAbilityCheck(PermissionName.PROVIDER_DROP); + const hasEditPermission = useAbilityCheck(PermissionName.IDENTITY_PROVIDER_UPDATE); + const hasDropPermission = useAbilityCheck(PermissionName.IDENTITY_PROVIDER_DELETE); const fields = [ { diff --git a/packages/client-ui/pages/admin/nodes/[id].vue b/packages/client-ui/pages/admin/nodes/[id].vue index c58bdc9fc..43829ffbd 100644 --- a/packages/client-ui/pages/admin/nodes/[id].vue +++ b/packages/client-ui/pages/admin/nodes/[id].vue @@ -46,7 +46,6 @@ export default defineNuxtComponent({ fields: [ '+registry_id', '+registry_project_id', - '+email', '+external_name', ], }, diff --git a/packages/client-ui/pages/admin/nodes/index.vue b/packages/client-ui/pages/admin/nodes/index.vue index 45070fa08..4bca4acb7 100644 --- a/packages/client-ui/pages/admin/nodes/index.vue +++ b/packages/client-ui/pages/admin/nodes/index.vue @@ -7,7 +7,7 @@