From 00854ed41143888004e02bb40e1138e91a4bbb17 Mon Sep 17 00:00:00 2001 From: Piotr Belke Date: Thu, 21 Nov 2024 16:24:30 +0100 Subject: [PATCH] IKC-418 Remove unused function --- .../model/admin/SystemFunctionName.java | 1 - .../kouncil/topic/TopicController.java | 2 +- .../db/migration/V7__topic_details.sql | 4 + .../src/lib/auth/system-function-name.ts | 1 - .../functions/functions.demo.service.ts | 56 ++++++------- .../list/user-groups.demo.service.ts | 78 +++++++++---------- 6 files changed, 66 insertions(+), 76 deletions(-) create mode 100644 kouncil-backend/src/main/resources/db/migration/V7__topic_details.sql diff --git a/kouncil-backend/src/main/java/com/consdata/kouncil/model/admin/SystemFunctionName.java b/kouncil-backend/src/main/java/com/consdata/kouncil/model/admin/SystemFunctionName.java index 4157f529..bda34fab 100644 --- a/kouncil-backend/src/main/java/com/consdata/kouncil/model/admin/SystemFunctionName.java +++ b/kouncil-backend/src/main/java/com/consdata/kouncil/model/admin/SystemFunctionName.java @@ -9,7 +9,6 @@ public enum SystemFunctionName { @FieldNameConstants.Include TOPIC_LIST, @FieldNameConstants.Include TOPIC_CREATE, @FieldNameConstants.Include TOPIC_UPDATE, - @FieldNameConstants.Include TOPIC_DETAILS, @FieldNameConstants.Include TOPIC_DELETE, @FieldNameConstants.Include TOPIC_MESSAGES, @FieldNameConstants.Include TOPIC_SEND_MESSAGE, diff --git a/kouncil-backend/src/main/java/com/consdata/kouncil/topic/TopicController.java b/kouncil-backend/src/main/java/com/consdata/kouncil/topic/TopicController.java index b80c9ed0..d06d8799 100644 --- a/kouncil-backend/src/main/java/com/consdata/kouncil/topic/TopicController.java +++ b/kouncil-backend/src/main/java/com/consdata/kouncil/topic/TopicController.java @@ -74,7 +74,7 @@ public void updateTopicPartitions(@RequestBody TopicData newTopic, @RequestParam topicService.updateTopicPartitions(newTopic, serverId); } - @RolesAllowed({Fields.TOPIC_DETAILS, Fields.TOPIC_UPDATE}) + @RolesAllowed(Fields.TOPIC_UPDATE) @GetMapping("/{topicName}") @EntryExitLogger public TopicData getTopicData(@PathVariable("topicName") String topicName, @RequestParam("serverId") String serverId) throws KouncilRuntimeException { diff --git a/kouncil-backend/src/main/resources/db/migration/V7__topic_details.sql b/kouncil-backend/src/main/resources/db/migration/V7__topic_details.sql new file mode 100644 index 00000000..355f8b82 --- /dev/null +++ b/kouncil-backend/src/main/resources/db/migration/V7__topic_details.sql @@ -0,0 +1,4 @@ +DELETE FROM system_functions_user_groups where function_id = (select id from system_function where name = 'TOPIC_DETAILS'); +DELETE FROM system_function where name='TOPIC_DETAILS'; + +commit; diff --git a/kouncil-frontend/libs/common-auth/src/lib/auth/system-function-name.ts b/kouncil-frontend/libs/common-auth/src/lib/auth/system-function-name.ts index 2c8840bd..0eb4bce9 100644 --- a/kouncil-frontend/libs/common-auth/src/lib/auth/system-function-name.ts +++ b/kouncil-frontend/libs/common-auth/src/lib/auth/system-function-name.ts @@ -3,7 +3,6 @@ export enum SystemFunctionName { TOPIC_LIST = 'TOPIC_LIST', TOPIC_CREATE = 'TOPIC_CREATE', TOPIC_UPDATE = 'TOPIC_UPDATE', - TOPIC_DETAILS = 'TOPIC_DETAILS', TOPIC_DELETE = 'TOPIC_DELETE', TOPIC_MESSAGES = 'TOPIC_MESSAGES', TOPIC_SEND_MESSAGE = 'TOPIC_SEND_MESSAGE', diff --git a/kouncil-frontend/libs/feat-user-groups/src/lib/user-groups-functions-matrix/functions/functions.demo.service.ts b/kouncil-frontend/libs/feat-user-groups/src/lib/user-groups-functions-matrix/functions/functions.demo.service.ts index 95d0a881..9be78bba 100644 --- a/kouncil-frontend/libs/feat-user-groups/src/lib/user-groups-functions-matrix/functions/functions.demo.service.ts +++ b/kouncil-frontend/libs/feat-user-groups/src/lib/user-groups-functions-matrix/functions/functions.demo.service.ts @@ -25,162 +25,156 @@ export class FunctionsDemoService implements FunctionsService { }, { id: 3, - name: SystemFunctionName.TOPIC_DETAILS, - label: 'View topic details', - functionGroup: FunctionGroup.TOPIC - }, - { - id: 4, name: SystemFunctionName.TOPIC_UPDATE, label: 'Update topic', functionGroup: FunctionGroup.TOPIC }, { - id: 5, + id: 4, name: SystemFunctionName.TOPIC_DELETE, label: 'Delete topic', functionGroup: FunctionGroup.TOPIC }, { - id: 6, + id: 5, name: SystemFunctionName.TOPIC_MESSAGES, label: 'View topic messages', functionGroup: FunctionGroup.TOPIC }, { - id: 7, + id: 6, name: SystemFunctionName.TOPIC_SEND_MESSAGE, label: 'Send message', functionGroup: FunctionGroup.TOPIC }, { - id: 8, + id: 7, name: SystemFunctionName.TOPIC_RESEND_MESSAGE, label: 'Resend message', functionGroup: FunctionGroup.TOPIC }, { - id: 9, + id: 8, name: SystemFunctionName.CONSUMER_GROUP_LIST, label: 'View consumer group list', functionGroup: FunctionGroup.CONSUMER_GROUP }, { - id: 10, + id: 9, name: SystemFunctionName.CONSUMER_GROUP_DELETE, label: 'Delete consumer group', functionGroup: FunctionGroup.CONSUMER_GROUP }, { - id: 11, + id: 10, name: SystemFunctionName.CONSUMER_GROUP_DETAILS, label: 'View consumer group details', functionGroup: FunctionGroup.CONSUMER_GROUP }, { - id: 12, + id: 11, name: SystemFunctionName.TRACK_LIST, label: 'View event track list', functionGroup: FunctionGroup.TOPIC }, { - id: 13, + id: 12, name: SystemFunctionName.SCHEMA_LIST, label: 'View schema list', functionGroup: FunctionGroup.SCHEMA_REGISTRY }, { - id: 14, + id: 13, name: SystemFunctionName.SCHEMA_DETAILS, label: 'View schema details', functionGroup: FunctionGroup.SCHEMA_REGISTRY }, { - id: 15, + id: 14, name: SystemFunctionName.SCHEMA_CREATE, label: 'Create new schema', functionGroup: FunctionGroup.SCHEMA_REGISTRY }, { - id: 16, + id: 15, name: SystemFunctionName.SCHEMA_UPDATE, label: 'Update schema', functionGroup: FunctionGroup.SCHEMA_REGISTRY }, { - id: 17, + id: 16, name: SystemFunctionName.SCHEMA_DELETE, label: 'Delete schema', functionGroup: FunctionGroup.SCHEMA_REGISTRY }, { - id: 18, + id: 17, name: SystemFunctionName.CLUSTER_LIST, label: 'Cluster list', functionGroup: FunctionGroup.CLUSTER }, { - id: 19, + id: 18, name: SystemFunctionName.CLUSTER_CREATE, label: 'Create new cluster', functionGroup: FunctionGroup.CLUSTER }, { - id: 20, + id: 19, name: SystemFunctionName.CLUSTER_UPDATE, label: 'Update cluster', functionGroup: FunctionGroup.CLUSTER }, { - id: 21, + id: 20, name: SystemFunctionName.CLUSTER_DETAILS, label: 'View cluster details', functionGroup: FunctionGroup.CLUSTER }, { - id: 22, + id: 21, name: SystemFunctionName.CLUSTER_DELETE, label: 'Delete cluster', functionGroup: FunctionGroup.CLUSTER }, { - id: 23, + id: 22, name: SystemFunctionName.BROKERS_LIST, label: 'View broker list', functionGroup: FunctionGroup.CLUSTER }, { - id: 24, + id: 23, name: SystemFunctionName.BROKER_DETAILS, label: 'View broker details', functionGroup: FunctionGroup.CLUSTER }, { - id: 25, + id: 24, name: SystemFunctionName.USER_GROUPS, label: 'Manage user groups', functionGroup: FunctionGroup.ADMIN }, { - id: 26, + id: 25, name: SystemFunctionName.USER_GROUPS_LIST, label: 'Groups list', functionGroup: FunctionGroup.ADMIN }, { - id: 27, + id: 26, name: SystemFunctionName.USER_GROUP_CREATE, label: 'Add new group', functionGroup: FunctionGroup.ADMIN }, { - id: 28, + id: 27, name: SystemFunctionName.USER_GROUP_UPDATE, label: 'Update group', functionGroup: FunctionGroup.ADMIN }, { - id: 29, + id: 28, name: SystemFunctionName.USER_GROUP_DELETE, label: 'Delete group', functionGroup: FunctionGroup.ADMIN diff --git a/kouncil-frontend/libs/feat-user-groups/src/lib/user-groups/list/user-groups.demo.service.ts b/kouncil-frontend/libs/feat-user-groups/src/lib/user-groups/list/user-groups.demo.service.ts index 9f5aa5f4..a6b95d9e 100644 --- a/kouncil-frontend/libs/feat-user-groups/src/lib/user-groups/list/user-groups.demo.service.ts +++ b/kouncil-frontend/libs/feat-user-groups/src/lib/user-groups/list/user-groups.demo.service.ts @@ -13,91 +13,91 @@ export class UserGroupsDemoService implements UserGroupsService { return of([ {id: 1, code: 'admin_group', name: 'Admin group', functions: [ { - id: 9, + id: 8, name: SystemFunctionName.CONSUMER_GROUP_LIST, label: 'View consumer group list', functionGroup: FunctionGroup.CONSUMER_GROUP }, { - id: 10, + id: 9, name: SystemFunctionName.CONSUMER_GROUP_DELETE, label: 'Delete consumer group', functionGroup: FunctionGroup.CONSUMER_GROUP }, { - id: 11, + id: 10, name: SystemFunctionName.CONSUMER_GROUP_DETAILS, label: 'View consumer group details', functionGroup: FunctionGroup.CONSUMER_GROUP }, { - id: 18, + id: 17, name: SystemFunctionName.CLUSTER_LIST, label: 'Cluster list', functionGroup: FunctionGroup.CLUSTER }, { - id: 19, + id: 18, name: SystemFunctionName.CLUSTER_CREATE, label: 'Create new cluster', functionGroup: FunctionGroup.CLUSTER }, { - id: 20, + id: 19, name: SystemFunctionName.CLUSTER_UPDATE, label: 'Update cluster', functionGroup: FunctionGroup.CLUSTER }, { - id: 21, + id: 20, name: SystemFunctionName.CLUSTER_DETAILS, label: 'View cluster details', functionGroup: FunctionGroup.CLUSTER }, { - id: 22, + id: 21, name: SystemFunctionName.CLUSTER_DELETE, label: 'Delete cluster', functionGroup: FunctionGroup.CLUSTER }, { - id: 23, + id: 22, name: SystemFunctionName.BROKERS_LIST, label: 'View broker list', functionGroup: FunctionGroup.CLUSTER }, { - id: 24, + id: 23, name: SystemFunctionName.BROKER_DETAILS, label: 'View broker details', functionGroup: FunctionGroup.CLUSTER }, { - id: 25, + id: 24, name: SystemFunctionName.USER_GROUPS, label: 'Manage user groups', functionGroup: FunctionGroup.ADMIN }, { - id: 26, + id: 25, name: SystemFunctionName.USER_GROUPS_LIST, label: 'Groups list', functionGroup: FunctionGroup.ADMIN }, { - id: 27, + id: 26, name: SystemFunctionName.USER_GROUP_CREATE, label: 'Add new group', functionGroup: FunctionGroup.ADMIN }, { - id: 28, + id: 27, name: SystemFunctionName.USER_GROUP_UPDATE, label: 'Update group', functionGroup: FunctionGroup.ADMIN }, { - id: 29, + id: 28, name: SystemFunctionName.USER_GROUP_DELETE, label: 'Delete group', functionGroup: FunctionGroup.ADMIN @@ -118,102 +118,96 @@ export class UserGroupsDemoService implements UserGroupsService { }, { id: 3, - name: SystemFunctionName.TOPIC_DETAILS, - label: 'View topic details', - functionGroup: FunctionGroup.TOPIC - }, - { - id: 4, name: SystemFunctionName.TOPIC_UPDATE, label: 'Update topic', functionGroup: FunctionGroup.TOPIC }, { - id: 5, + id: 4, name: SystemFunctionName.TOPIC_DELETE, label: 'Delete topic', functionGroup: FunctionGroup.TOPIC }, { - id: 6, + id: 5, name: SystemFunctionName.TOPIC_MESSAGES, label: 'View topic messages', functionGroup: FunctionGroup.TOPIC }, { - id: 7, + id: 6, name: SystemFunctionName.TOPIC_SEND_MESSAGE, label: 'Send message', functionGroup: FunctionGroup.TOPIC }, { - id: 8, + id: 7, name: SystemFunctionName.TOPIC_RESEND_MESSAGE, label: 'Resend message', functionGroup: FunctionGroup.TOPIC }, { - id: 12, + id: 11, name: SystemFunctionName.TRACK_LIST, label: 'View event track list', functionGroup: FunctionGroup.TOPIC }, { - id: 13, + id: 12, name: SystemFunctionName.SCHEMA_LIST, label: 'View schema list', functionGroup: FunctionGroup.SCHEMA_REGISTRY }, { - id: 14, + id: 13, name: SystemFunctionName.SCHEMA_DETAILS, label: 'View schema details', functionGroup: FunctionGroup.SCHEMA_REGISTRY }, { - id: 15, + id: 14, name: SystemFunctionName.SCHEMA_CREATE, label: 'Create new schema', functionGroup: FunctionGroup.SCHEMA_REGISTRY }, { - id: 16, + id: 15, name: SystemFunctionName.SCHEMA_UPDATE, label: 'Update schema', functionGroup: FunctionGroup.SCHEMA_REGISTRY }, { - id: 17, + id: 16, name: SystemFunctionName.SCHEMA_DELETE, label: 'Delete schema', functionGroup: FunctionGroup.SCHEMA_REGISTRY }, { - id: 18, + id: 17, name: SystemFunctionName.CLUSTER_LIST, label: 'Cluster list', functionGroup: FunctionGroup.CLUSTER }, { - id: 19, + id: 18, name: SystemFunctionName.CLUSTER_CREATE, label: 'Create new cluster', functionGroup: FunctionGroup.CLUSTER }, { - id: 20, + id: 19, name: SystemFunctionName.CLUSTER_UPDATE, label: 'Update cluster', functionGroup: FunctionGroup.CLUSTER }, { - id: 21, + id: 20, name: SystemFunctionName.CLUSTER_DETAILS, label: 'View cluster details', functionGroup: FunctionGroup.CLUSTER }, { - id: 22, + id: 21, name: SystemFunctionName.CLUSTER_DELETE, label: 'Delete cluster', functionGroup: FunctionGroup.CLUSTER @@ -227,37 +221,37 @@ export class UserGroupsDemoService implements UserGroupsService { functionGroup: FunctionGroup.TOPIC }, { - id: 6, + id: 5, name: SystemFunctionName.TOPIC_MESSAGES, label: 'View topic messages', functionGroup: FunctionGroup.TOPIC }, { - id: 12, + id: 11, name: SystemFunctionName.TRACK_LIST, label: 'View event track list', functionGroup: FunctionGroup.TOPIC }, { - id: 13, + id: 12, name: SystemFunctionName.SCHEMA_LIST, label: 'View schema list', functionGroup: FunctionGroup.SCHEMA_REGISTRY }, { - id: 14, + id: 13, name: SystemFunctionName.SCHEMA_DETAILS, label: 'View schema details', functionGroup: FunctionGroup.SCHEMA_REGISTRY }, { - id: 18, + id: 17, name: SystemFunctionName.CLUSTER_LIST, label: 'Cluster list', functionGroup: FunctionGroup.CLUSTER }, { - id: 21, + id: 20, name: SystemFunctionName.CLUSTER_DETAILS, label: 'View cluster details', functionGroup: FunctionGroup.CLUSTER