private void setupResponse(final RolePermission rolePermission, final Role role) { final RolePermissionResponse response = new RolePermissionResponse(); response.setId(rolePermission.getUuid()); response.setRoleId(role.getUuid()); response.setRule(rolePermission.getRule()); response.setRulePermission(rolePermission.getPermission()); response.setDescription(rolePermission.getDescription()); response.setResponseName(getCommandName()); response.setObjectName("rolepermission"); setResponseObject(response); }
private void setupResponse(final List<RolePermission> rolePermissions, final Long roleId) { final Role roleProvided = roleService.findRole(roleId); final ListResponse<RolePermissionResponse> response = new ListResponse<>(); final List<RolePermissionResponse> rolePermissionResponses = new ArrayList<>(); for (final RolePermission rolePermission : rolePermissions) { final RolePermissionResponse rolePermissionResponse = new RolePermissionResponse(); Role role = roleProvided; if (role == null) { role = roleService.findRole(rolePermission.getRoleId()); } rolePermissionResponse.setRoleId(role.getUuid()); rolePermissionResponse.setRoleName(role.getName()); rolePermissionResponse.setId(rolePermission.getUuid()); rolePermissionResponse.setRule(rolePermission.getRule()); rolePermissionResponse.setRulePermission(rolePermission.getPermission()); rolePermissionResponse.setDescription(rolePermission.getDescription()); rolePermissionResponse.setObjectName("rolepermission"); rolePermissionResponses.add(rolePermissionResponse); } response.setResponses(rolePermissionResponses); response.setResponseName(getCommandName()); setResponseObject(response); }
if (permission.getRule().matches(commandName)) { if (RolePermission.Permission.ALLOW.equals(permission.getPermission())) { return true;