From 149aeb1069078ff09d0651b05bf6bb8e4515da31 Mon Sep 17 00:00:00 2001 From: Arnab Dutta Date: Thu, 6 Jan 2022 22:57:53 +0530 Subject: [PATCH] feat: add POST /rolePermissionsMapping for adding new rolePermissionsMapping entry #144 --- .../plugin/adminui/service/user/UserManagementService.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/plugins/admin-ui-plugin/src/main/java/io/jans/ca/plugin/adminui/service/user/UserManagementService.java b/plugins/admin-ui-plugin/src/main/java/io/jans/ca/plugin/adminui/service/user/UserManagementService.java index 3e773ed0db2..9d7902065da 100644 --- a/plugins/admin-ui-plugin/src/main/java/io/jans/ca/plugin/adminui/service/user/UserManagementService.java +++ b/plugins/admin-ui-plugin/src/main/java/io/jans/ca/plugin/adminui/service/user/UserManagementService.java @@ -251,7 +251,6 @@ public List addPermissionsToRole(RolePermissionMapping ro entryManager.merge(adminConf); return adminConf.getDynamic().getRolePermissionMapping(); } catch (ApplicationException e) { - log.error(e.getMessage()); throw e; } catch (Exception e) { log.error(ErrorResponse.ERROR_IN_MAPPING_ROLE_PERMISSION.getDescription(), e); @@ -287,14 +286,9 @@ public List mapPermissionsToRole(RolePermissionMapping ro } Optional rolePermissionMappingOptional = roleScopeMappingList.stream().findFirst(); - List mappedPermissions = Lists.newArrayList(); - if (rolePermissionMappingOptional.isPresent()) { - mappedPermissions = rolePermissionMappingOptional.get().getPermissions(); - } //remove duplicate permissions Set scopesSet = new LinkedHashSet<>(rolePermissionMappingArg.getPermissions()); - //scopesSet.addAll(rolePermissionMappingArg.getPermissions()); List combinedScopes = new ArrayList<>(scopesSet); if (adminConf.getDynamic().getRolePermissionMapping() @@ -311,7 +305,6 @@ public List mapPermissionsToRole(RolePermissionMapping ro entryManager.merge(adminConf); return adminConf.getDynamic().getRolePermissionMapping(); } catch (ApplicationException e) { - log.error(e.getMessage()); throw e; } catch (Exception e) { log.error(ErrorResponse.ERROR_IN_MAPPING_ROLE_PERMISSION.getDescription(), e);