1 |
59219
|
k.triantaf
|
package eu.dnetlib.openaire.usermanagement.api;
|
2 |
|
|
|
3 |
|
|
import com.google.gson.JsonArray;
|
4 |
|
|
import com.google.gson.JsonObject;
|
5 |
59337
|
k.triantaf
|
import com.google.gson.JsonParser;
|
6 |
59851
|
k.triantaf
|
import eu.dnetlib.openaire.user.login.utils.AuthoritiesUpdater;
|
7 |
59502
|
k.triantaf
|
import eu.dnetlib.openaire.user.pojos.RoleVerification;
|
8 |
59337
|
k.triantaf
|
import eu.dnetlib.openaire.user.utils.EmailSender;
|
9 |
59219
|
k.triantaf
|
import eu.dnetlib.openaire.usermanagement.dto.Role;
|
10 |
59851
|
k.triantaf
|
import eu.dnetlib.openaire.usermanagement.utils.AuthorizationService;
|
11 |
59219
|
k.triantaf
|
import eu.dnetlib.openaire.usermanagement.utils.JsonUtils;
|
12 |
|
|
import eu.dnetlib.openaire.usermanagement.utils.RegistryCalls;
|
13 |
|
|
import eu.dnetlib.openaire.usermanagement.utils.VerificationUtils;
|
14 |
|
|
import org.apache.log4j.Logger;
|
15 |
59851
|
k.triantaf
|
import org.mitre.openid.connect.model.OIDCAuthenticationToken;
|
16 |
59219
|
k.triantaf
|
import org.springframework.beans.factory.annotation.Autowired;
|
17 |
|
|
import org.springframework.http.HttpStatus;
|
18 |
60716
|
k.triantaf
|
import org.springframework.security.access.method.P;
|
19 |
59219
|
k.triantaf
|
import org.springframework.security.access.prepost.PreAuthorize;
|
20 |
59851
|
k.triantaf
|
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
21 |
|
|
import org.springframework.security.core.context.SecurityContextHolder;
|
22 |
59219
|
k.triantaf
|
import org.springframework.stereotype.Component;
|
23 |
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
24 |
|
|
|
25 |
59337
|
k.triantaf
|
import javax.mail.MessagingException;
|
26 |
59219
|
k.triantaf
|
import javax.ws.rs.*;
|
27 |
|
|
import javax.ws.rs.core.MediaType;
|
28 |
|
|
import javax.ws.rs.core.Response;
|
29 |
59851
|
k.triantaf
|
import java.util.Collection;
|
30 |
|
|
import java.util.HashSet;
|
31 |
60716
|
k.triantaf
|
import java.util.List;
|
32 |
59219
|
k.triantaf
|
|
33 |
|
|
@Component(value = "RegistryService")
|
34 |
|
|
@Path("/registry")
|
35 |
|
|
public class RegistryService {
|
36 |
|
|
|
37 |
|
|
private static final Logger logger = Logger.getLogger(RegistryService.class);
|
38 |
|
|
|
39 |
|
|
@Autowired
|
40 |
|
|
private RegistryCalls calls;
|
41 |
|
|
|
42 |
|
|
@Autowired
|
43 |
|
|
private JsonUtils jsonUtils;
|
44 |
|
|
|
45 |
|
|
@Autowired
|
46 |
59337
|
k.triantaf
|
private EmailSender emailSender;
|
47 |
|
|
|
48 |
|
|
@Autowired
|
49 |
59219
|
k.triantaf
|
private VerificationUtils verificationUtils;
|
50 |
|
|
|
51 |
59851
|
k.triantaf
|
@Autowired
|
52 |
|
|
private AuthoritiesUpdater authoritiesUpdater;
|
53 |
59337
|
k.triantaf
|
|
54 |
59851
|
k.triantaf
|
@Autowired
|
55 |
|
|
private AuthorizationService authorizationService;
|
56 |
|
|
|
57 |
59219
|
k.triantaf
|
/**
|
58 |
59274
|
k.triantaf
|
* Subscribe to a type(Community, etc.) with id(ee, egi, etc.)
|
59 |
59337
|
k.triantaf
|
*/
|
60 |
59219
|
k.triantaf
|
@Path("/subscribe/{type}/{id}")
|
61 |
|
|
@POST
|
62 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
63 |
59502
|
k.triantaf
|
@PreAuthorize("isAuthenticated() and @AuthorizationService.isCommunity(#type)")
|
64 |
59219
|
k.triantaf
|
public Response subscribe(@PathParam("type") String type, @PathParam("id") String id) {
|
65 |
|
|
Integer coPersonId = calls.getCoPersonIdByIdentifier();
|
66 |
|
|
Integer couId = calls.getCouId(type, id);
|
67 |
|
|
if (couId != null) {
|
68 |
|
|
Integer role = calls.getRoleId(coPersonId, couId);
|
69 |
|
|
calls.assignMemberRole(coPersonId, couId, role);
|
70 |
60716
|
k.triantaf
|
authoritiesUpdater.update(authorizationService.getEmail(), old -> {
|
71 |
59851
|
k.triantaf
|
HashSet<SimpleGrantedAuthority> authorities = new HashSet<>((Collection<? extends SimpleGrantedAuthority>) old);
|
72 |
|
|
authorities.add(new SimpleGrantedAuthority(authorizationService.member(type, id)));
|
73 |
|
|
return authorities;
|
74 |
|
|
});
|
75 |
59219
|
k.triantaf
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse("Role has been assigned").toString()).type(MediaType.APPLICATION_JSON).build();
|
76 |
|
|
} else {
|
77 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
78 |
|
|
}
|
79 |
|
|
}
|
80 |
|
|
|
81 |
|
|
/**
|
82 |
59502
|
k.triantaf
|
* Unsubscribe from type(Community, etc.) with id(ee, egi, etc.).
|
83 |
59219
|
k.triantaf
|
* If user has manager role for this entity, it will be removed too.
|
84 |
59337
|
k.triantaf
|
*/
|
85 |
59219
|
k.triantaf
|
@Path("/unsubscribe/{type}/{id}")
|
86 |
|
|
@POST
|
87 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
88 |
59502
|
k.triantaf
|
@PreAuthorize("isAuthenticated() and @AuthorizationService.isCommunity(#type)")
|
89 |
59219
|
k.triantaf
|
public Response unsubscribe(@PathParam("type") String type, @PathParam("id") String id) {
|
90 |
|
|
Integer coPersonId = calls.getCoPersonIdByIdentifier();
|
91 |
|
|
Integer couId = calls.getCouId(type, id);
|
92 |
|
|
if (couId != null) {
|
93 |
|
|
Integer role = calls.getRoleId(coPersonId, couId);
|
94 |
|
|
if (role != null) {
|
95 |
|
|
calls.removeAdminRole(coPersonId, couId);
|
96 |
|
|
calls.removeMemberRole(coPersonId, couId, role);
|
97 |
60716
|
k.triantaf
|
authoritiesUpdater.update(authorizationService.getEmail(), old -> {
|
98 |
59851
|
k.triantaf
|
HashSet<SimpleGrantedAuthority> authorities = new HashSet<>((Collection<? extends SimpleGrantedAuthority>) old);
|
99 |
|
|
authorities.remove(new SimpleGrantedAuthority(authorizationService.manager(type, id)));
|
100 |
|
|
authorities.remove(new SimpleGrantedAuthority(authorizationService.member(type, id)));
|
101 |
|
|
return authorities;
|
102 |
|
|
});
|
103 |
59219
|
k.triantaf
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse("Role has been removed").toString()).type(MediaType.APPLICATION_JSON).build();
|
104 |
|
|
} else
|
105 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("User does not have this role").toString()).type(MediaType.APPLICATION_JSON).build();
|
106 |
|
|
} else {
|
107 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
108 |
|
|
}
|
109 |
|
|
}
|
110 |
|
|
|
111 |
|
|
/**
|
112 |
|
|
* Create a new role with the given name and description.
|
113 |
59274
|
k.triantaf
|
**/
|
114 |
59219
|
k.triantaf
|
@Path("/createRole")
|
115 |
|
|
@POST
|
116 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
117 |
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
118 |
59923
|
k.triantaf
|
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN)")
|
119 |
59219
|
k.triantaf
|
public Response createRole(@RequestBody Role role) {
|
120 |
60716
|
k.triantaf
|
if (calls.getCouId(role.getName()) == null) {
|
121 |
|
|
calls.createRole(role);
|
122 |
|
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse("Role has been created").toString()).type(MediaType.APPLICATION_JSON).build();
|
123 |
60483
|
katerina.i
|
} else {
|
124 |
|
|
return Response.status(HttpStatus.CONFLICT.value()).entity(jsonUtils.createResponse("Role has already existed").toString()).type(MediaType.APPLICATION_JSON).build();
|
125 |
|
|
}
|
126 |
59219
|
k.triantaf
|
}
|
127 |
|
|
|
128 |
|
|
/**
|
129 |
|
|
* Invite user with email to manage a type(Community, etc.) with id(ee, egi, etc.)
|
130 |
|
|
* Auto generated link and code will be sent as response.
|
131 |
59337
|
k.triantaf
|
*/
|
132 |
59923
|
k.triantaf
|
@Path("/invite/{type}/{id}/manager")
|
133 |
59219
|
k.triantaf
|
@POST
|
134 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
135 |
59923
|
k.triantaf
|
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, " +
|
136 |
59345
|
k.triantaf
|
"@AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
|
137 |
59923
|
k.triantaf
|
public Response inviteManager(@PathParam("type") String type, @PathParam("id") String id, @RequestBody String body) {
|
138 |
59219
|
k.triantaf
|
Integer couId = calls.getCouId(type, id);
|
139 |
|
|
if (couId != null) {
|
140 |
59923
|
k.triantaf
|
JsonObject details = new JsonParser().parse(body).getAsJsonObject();
|
141 |
|
|
JsonObject email = details.get("email").getAsJsonObject();
|
142 |
|
|
String recipient = email.get("recipient").getAsString();
|
143 |
|
|
Integer coPersonId = calls.getCoPersonIdByEmail(recipient);
|
144 |
59502
|
k.triantaf
|
if (coPersonId == null || calls.getUserAdminGroup(coPersonId, couId) == null) {
|
145 |
59923
|
k.triantaf
|
JsonObject invitation = verificationUtils.createManagerInvitation(recipient, type, id);
|
146 |
|
|
return sendEmail(details, email, coPersonId, invitation);
|
147 |
59274
|
k.triantaf
|
} else {
|
148 |
59285
|
k.triantaf
|
return Response.status(HttpStatus.CONFLICT.value()).entity(jsonUtils.createResponse("User has been already manager of this " + type).toString()).type(MediaType.APPLICATION_JSON).build();
|
149 |
59274
|
k.triantaf
|
}
|
150 |
59219
|
k.triantaf
|
} else {
|
151 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
152 |
|
|
}
|
153 |
|
|
}
|
154 |
|
|
|
155 |
|
|
/**
|
156 |
59502
|
k.triantaf
|
* Invite user with email to be a member of a type(Community, etc.) with id(ee, egi, etc.)
|
157 |
|
|
* Auto generated link and code will be sent as response.
|
158 |
|
|
*/
|
159 |
59923
|
k.triantaf
|
@Path("/invite/{type}/{id}/member")
|
160 |
59502
|
k.triantaf
|
@POST
|
161 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
162 |
59923
|
k.triantaf
|
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, " +
|
163 |
59502
|
k.triantaf
|
"@AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
|
164 |
59923
|
k.triantaf
|
public Response inviteMember(@PathParam("type") String type, @PathParam("id") String id, @RequestBody String body) {
|
165 |
60483
|
katerina.i
|
Integer couId = calls.getCouId(type, id, false);
|
166 |
59502
|
k.triantaf
|
if (couId != null) {
|
167 |
59923
|
k.triantaf
|
JsonObject details = new JsonParser().parse(body).getAsJsonObject();
|
168 |
|
|
JsonObject email = details.get("email").getAsJsonObject();
|
169 |
|
|
String recipient = email.get("recipient").getAsString();
|
170 |
|
|
Integer coPersonId = calls.getCoPersonIdByEmail(recipient);
|
171 |
59502
|
k.triantaf
|
if (coPersonId == null || calls.getRoleId(coPersonId, couId) == null) {
|
172 |
59923
|
k.triantaf
|
JsonObject invitation = verificationUtils.createMemberInvitation(recipient, type, id);
|
173 |
|
|
return sendEmail(details, email, coPersonId, invitation);
|
174 |
59502
|
k.triantaf
|
} else {
|
175 |
|
|
return Response.status(HttpStatus.CONFLICT.value()).entity(jsonUtils.createResponse("User has been already member of this " + type).toString()).type(MediaType.APPLICATION_JSON).build();
|
176 |
|
|
}
|
177 |
|
|
} else {
|
178 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
179 |
|
|
}
|
180 |
|
|
}
|
181 |
|
|
|
182 |
59923
|
k.triantaf
|
private Response sendEmail(JsonObject details, JsonObject email, Integer coPersonId, JsonObject invitation) {
|
183 |
60716
|
k.triantaf
|
String name = (coPersonId != null) ? calls.getUserNames(coPersonId) : "User";
|
184 |
59923
|
k.triantaf
|
String link = details.get("link").getAsString() + invitation.get("link").getAsString();
|
185 |
|
|
String subject = email.get("subject").getAsString();
|
186 |
|
|
String message = email.get("body").getAsString().
|
187 |
|
|
replace("((__user__))", name).
|
188 |
|
|
replace("((__link__))", link).
|
189 |
|
|
replace("((__code__))", invitation.get("code").getAsString());
|
190 |
|
|
try {
|
191 |
|
|
emailSender.sendEmail(email.get("recipient").getAsString(), subject, message);
|
192 |
|
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(invitation).toString()).type(MediaType.APPLICATION_JSON).build();
|
193 |
|
|
} catch (MessagingException e) {
|
194 |
|
|
logger.error(e.getMessage());
|
195 |
|
|
verificationUtils.deleteVerification(invitation.get("link").getAsString());
|
196 |
|
|
return Response.status(HttpStatus.BAD_REQUEST.value()).entity(jsonUtils.createResponse("Email sent failed").toString()).type(MediaType.APPLICATION_JSON).build();
|
197 |
|
|
}
|
198 |
|
|
}
|
199 |
|
|
|
200 |
59502
|
k.triantaf
|
/**
|
201 |
59242
|
k.triantaf
|
* Cancel invitation to user with email for managing a type(Community, etc.) with id(ee, egi, etc.)
|
202 |
59337
|
k.triantaf
|
*/
|
203 |
59242
|
k.triantaf
|
@Path("/invite/{type}/{id}/manager/{email}")
|
204 |
|
|
@DELETE
|
205 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
206 |
59923
|
k.triantaf
|
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, " +
|
207 |
59345
|
k.triantaf
|
"@AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
|
208 |
59502
|
k.triantaf
|
public Response cancelManagerInvitations(@PathParam("type") String type, @PathParam("id") String id, @PathParam("email") String email) {
|
209 |
59242
|
k.triantaf
|
Integer couId = calls.getCouId(type, id);
|
210 |
|
|
if (couId != null) {
|
211 |
59502
|
k.triantaf
|
verificationUtils.deleteManagerVerifications(email, type, id);
|
212 |
59242
|
k.triantaf
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse("Invitations have been deleted").toString()).type(MediaType.APPLICATION_JSON).build();
|
213 |
|
|
} else {
|
214 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
215 |
|
|
}
|
216 |
|
|
}
|
217 |
|
|
|
218 |
|
|
/**
|
219 |
59502
|
k.triantaf
|
* Cancel invitation to user with email for being member of a type(Community, etc.) with id(ee, egi, etc.)
|
220 |
|
|
*/
|
221 |
|
|
@Path("/invite/{type}/{id}/member/{email}")
|
222 |
|
|
@DELETE
|
223 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
224 |
59923
|
k.triantaf
|
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, " +
|
225 |
59502
|
k.triantaf
|
"@AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
|
226 |
|
|
public Response cancelMemberInvitations(@PathParam("type") String type, @PathParam("id") String id, @PathParam("email") String email) {
|
227 |
60483
|
katerina.i
|
Integer couId = calls.getCouId(type, id, false);
|
228 |
59502
|
k.triantaf
|
if (couId != null) {
|
229 |
|
|
verificationUtils.deleteMemberVerifications(email, type, id);
|
230 |
|
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse("Invitations have been deleted").toString()).type(MediaType.APPLICATION_JSON).build();
|
231 |
|
|
} else {
|
232 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
233 |
|
|
}
|
234 |
|
|
}
|
235 |
|
|
|
236 |
|
|
/**
|
237 |
59242
|
k.triantaf
|
* Get the invited managers for a type(Community, etc.) with id(ee, egi, etc.)
|
238 |
59337
|
k.triantaf
|
*/
|
239 |
59274
|
k.triantaf
|
@Path("/invite/{type}/{id}/managers/")
|
240 |
59242
|
k.triantaf
|
@GET
|
241 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
242 |
59923
|
k.triantaf
|
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, " +
|
243 |
59345
|
k.triantaf
|
"@AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
|
244 |
59242
|
k.triantaf
|
public Response getInvitedManagers(@PathParam("type") String type, @PathParam("id") String id) {
|
245 |
59502
|
k.triantaf
|
JsonArray invited = verificationUtils.getInvitedManagers(type, id);
|
246 |
59242
|
k.triantaf
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(invited).toString()).type(MediaType.APPLICATION_JSON).build();
|
247 |
|
|
}
|
248 |
|
|
|
249 |
|
|
/**
|
250 |
59502
|
k.triantaf
|
* Get the invited members for a type(Community, etc.) with id(ee, egi, etc.)
|
251 |
|
|
*/
|
252 |
|
|
@Path("/invite/{type}/{id}/members/")
|
253 |
|
|
@GET
|
254 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
255 |
59923
|
k.triantaf
|
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, " +
|
256 |
59502
|
k.triantaf
|
"@AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
|
257 |
|
|
public Response getInviteMembers(@PathParam("type") String type, @PathParam("id") String id) {
|
258 |
|
|
JsonArray invited = verificationUtils.getInvitedMembers(type, id);
|
259 |
|
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(invited).toString()).type(MediaType.APPLICATION_JSON).build();
|
260 |
|
|
}
|
261 |
|
|
|
262 |
|
|
/**
|
263 |
59219
|
k.triantaf
|
* Get the verification with a specific id only if it refers to the logged in user
|
264 |
59337
|
k.triantaf
|
*/
|
265 |
59219
|
k.triantaf
|
@Path("verification/{id}")
|
266 |
|
|
@GET
|
267 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
268 |
|
|
@PreAuthorize("isAuthenticated()")
|
269 |
|
|
public Response getVerification(@PathParam("id") String id) {
|
270 |
59502
|
k.triantaf
|
RoleVerification verification = verificationUtils.getVerification(id);
|
271 |
|
|
if (verification != null) {
|
272 |
60716
|
k.triantaf
|
if (verification.getEmail().equalsIgnoreCase(authorizationService.getEmail())) {
|
273 |
59502
|
k.triantaf
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(jsonUtils.createVerification(verification)).toString()).type(MediaType.APPLICATION_JSON).build();
|
274 |
59219
|
k.triantaf
|
} else {
|
275 |
|
|
return Response.status(HttpStatus.FORBIDDEN.value()).entity(jsonUtils.createResponse("Forbidden verification").toString()).type(MediaType.APPLICATION_JSON).build();
|
276 |
|
|
}
|
277 |
|
|
} else {
|
278 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Verification has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
279 |
|
|
}
|
280 |
|
|
}
|
281 |
|
|
|
282 |
|
|
/**
|
283 |
59242
|
k.triantaf
|
* Delete the verification with a specific id.
|
284 |
59337
|
k.triantaf
|
*/
|
285 |
59242
|
k.triantaf
|
@Path("verification/{id}")
|
286 |
|
|
@DELETE
|
287 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
288 |
59274
|
k.triantaf
|
@PreAuthorize("isAuthenticated() && @VerificationUtils.ownedVerification(#id)")
|
289 |
59242
|
k.triantaf
|
public Response deleteVerification(@PathParam("id") String id) {
|
290 |
|
|
if (verificationUtils.getVerification(id) != null) {
|
291 |
|
|
verificationUtils.deleteVerification(id);
|
292 |
|
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(jsonUtils.createResponse("Verification deleted")).toString()).type(MediaType.APPLICATION_JSON).build();
|
293 |
|
|
} else {
|
294 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse(jsonUtils.createResponse("Verification has not been found")).toString()).type(MediaType.APPLICATION_JSON).build();
|
295 |
|
|
}
|
296 |
|
|
}
|
297 |
|
|
|
298 |
|
|
/**
|
299 |
59219
|
k.triantaf
|
* Verify the verification with the specific id, if the code is correct and it refers to the logged in user.
|
300 |
|
|
* Manager role is assigned to this user, along with the member role.
|
301 |
59337
|
k.triantaf
|
*/
|
302 |
59502
|
k.triantaf
|
@Path("verification/manager/{id}")
|
303 |
59219
|
k.triantaf
|
@POST
|
304 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
305 |
|
|
@PreAuthorize("isAuthenticated()")
|
306 |
59502
|
k.triantaf
|
public Response verifyManager(@PathParam("id") String id, @RequestBody String code) {
|
307 |
|
|
RoleVerification verification = verificationUtils.getVerification(id);
|
308 |
|
|
if (verification != null && verification.getVerificationType().equals("manager")) {
|
309 |
60716
|
k.triantaf
|
Integer coPersonId = calls.getCoPersonIdByIdentifier();
|
310 |
59219
|
k.triantaf
|
if (coPersonId != null) {
|
311 |
60716
|
k.triantaf
|
if (verification.getEmail().equalsIgnoreCase(authorizationService.getEmail())) {
|
312 |
59502
|
k.triantaf
|
if (verification.getVerificationCode().equals(code)) {
|
313 |
|
|
Integer couId = calls.getCouId(verification.getType(), verification.getEntity());
|
314 |
59219
|
k.triantaf
|
if (couId != null) {
|
315 |
|
|
Integer role = calls.getRoleId(coPersonId, couId);
|
316 |
|
|
calls.assignMemberRole(coPersonId, couId, role);
|
317 |
60716
|
k.triantaf
|
if (verification.getType().equals("community") || verification.getType().equals("ri")) {
|
318 |
|
|
Integer riCouId = calls.getCouId("ri", verification.getEntity(), false);
|
319 |
|
|
if (riCouId != null) {
|
320 |
|
|
calls.assignMemberRole(coPersonId, riCouId, calls.getRoleId(coPersonId, riCouId));
|
321 |
|
|
verificationUtils.deleteMemberVerifications(verification.getEmail(), "community", verification.getEntity());
|
322 |
|
|
verificationUtils.deleteMemberVerifications(verification.getEmail(), "ri", verification.getEntity());
|
323 |
|
|
} else {
|
324 |
|
|
verificationUtils.deleteMemberVerifications(verification.getEmail(), "community", verification.getEntity());
|
325 |
|
|
}
|
326 |
|
|
} else {
|
327 |
|
|
verificationUtils.deleteMemberVerifications(verification.getEmail(), verification.getType(), verification.getEntity());
|
328 |
|
|
}
|
329 |
59219
|
k.triantaf
|
if (calls.getUserAdminGroup(coPersonId, couId) == null) {
|
330 |
60716
|
k.triantaf
|
if (verification.getType().equals("community") || verification.getType().equals("ri")) {
|
331 |
|
|
verificationUtils.deleteManagerVerifications(verification.getEmail(), "community", verification.getEntity());
|
332 |
|
|
verificationUtils.deleteManagerVerifications(verification.getEmail(), "ri", verification.getEntity());
|
333 |
|
|
} else {
|
334 |
|
|
verificationUtils.deleteManagerVerifications(verification.getEmail(), verification.getType(), verification.getEntity());
|
335 |
|
|
}
|
336 |
59219
|
k.triantaf
|
calls.assignAdminRole(coPersonId, couId);
|
337 |
59851
|
k.triantaf
|
authoritiesUpdater.update(verification.getEmail(), old -> {
|
338 |
|
|
HashSet<SimpleGrantedAuthority> authorities = new HashSet<>((Collection<? extends SimpleGrantedAuthority>) old);
|
339 |
|
|
authorities.add(new SimpleGrantedAuthority(authorizationService.member(verification.getType(), verification.getEntity())));
|
340 |
|
|
authorities.add(new SimpleGrantedAuthority(authorizationService.manager(verification.getType(), verification.getEntity())));
|
341 |
|
|
return authorities;
|
342 |
|
|
});
|
343 |
59219
|
k.triantaf
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse("Admin role has been assigned").toString()).type(MediaType.APPLICATION_JSON).build();
|
344 |
|
|
} else {
|
345 |
|
|
return Response.status(HttpStatus.CONFLICT.value()).entity(jsonUtils.createResponse("User is already admin of this cou").toString()).type(MediaType.APPLICATION_JSON).build();
|
346 |
|
|
}
|
347 |
|
|
} else {
|
348 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
349 |
|
|
}
|
350 |
|
|
} else {
|
351 |
60716
|
k.triantaf
|
return Response.status(HttpStatus.BAD_REQUEST.value()).entity(jsonUtils.createResponse("Verification code is wrong").toString()).type(MediaType.APPLICATION_JSON).build();
|
352 |
59219
|
k.triantaf
|
}
|
353 |
|
|
} else {
|
354 |
|
|
return Response.status(HttpStatus.FORBIDDEN.value()).entity(jsonUtils.createResponse("Forbidden verification").toString()).type(MediaType.APPLICATION_JSON).build();
|
355 |
|
|
}
|
356 |
|
|
} else {
|
357 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("User has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
358 |
|
|
}
|
359 |
|
|
} else {
|
360 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Verification has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
361 |
|
|
}
|
362 |
|
|
}
|
363 |
|
|
|
364 |
|
|
/**
|
365 |
59502
|
k.triantaf
|
* Verify the verification with the specific id, if the code is correct and it refers to the logged in user.
|
366 |
|
|
* Member role is assigned to this user, along with the member role.
|
367 |
|
|
*/
|
368 |
|
|
@Path("verification/member/{id}")
|
369 |
|
|
@POST
|
370 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
371 |
|
|
@PreAuthorize("isAuthenticated()")
|
372 |
|
|
public Response verifyMember(@PathParam("id") String id, @RequestBody String code) {
|
373 |
|
|
RoleVerification verification = verificationUtils.getVerification(id);
|
374 |
|
|
if (verification != null && verification.getVerificationType().equals("member")) {
|
375 |
60716
|
k.triantaf
|
Integer coPersonId = calls.getCoPersonIdByIdentifier();
|
376 |
59502
|
k.triantaf
|
if (coPersonId != null) {
|
377 |
60716
|
k.triantaf
|
if (verification.getEmail().equalsIgnoreCase(authorizationService.getEmail())) {
|
378 |
59502
|
k.triantaf
|
if (verification.getVerificationCode().equals(code)) {
|
379 |
60483
|
katerina.i
|
Integer couId = calls.getCouId(verification.getType(), verification.getEntity(), false);
|
380 |
59502
|
k.triantaf
|
if (couId != null) {
|
381 |
|
|
Integer role = calls.getRoleId(coPersonId, couId);
|
382 |
|
|
calls.assignMemberRole(coPersonId, couId, role);
|
383 |
59851
|
k.triantaf
|
authoritiesUpdater.update(verification.getEmail(), old -> {
|
384 |
|
|
HashSet<SimpleGrantedAuthority> authorities = new HashSet<>((Collection<? extends SimpleGrantedAuthority>) old);
|
385 |
|
|
authorities.add(new SimpleGrantedAuthority(authorizationService.member(verification.getType(), verification.getEntity())));
|
386 |
|
|
return authorities;
|
387 |
|
|
});
|
388 |
59502
|
k.triantaf
|
verificationUtils.deleteMemberVerifications(verification.getEmail(), verification.getType(), verification.getEntity());
|
389 |
|
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse("Member role has been assigned").toString()).type(MediaType.APPLICATION_JSON).build();
|
390 |
|
|
} else {
|
391 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
392 |
|
|
}
|
393 |
|
|
} else {
|
394 |
|
|
return Response.status(HttpStatus.FORBIDDEN.value()).entity(jsonUtils.createResponse("Verification code is wrong").toString()).type(MediaType.APPLICATION_JSON).build();
|
395 |
|
|
}
|
396 |
|
|
} else {
|
397 |
|
|
return Response.status(HttpStatus.FORBIDDEN.value()).entity(jsonUtils.createResponse("Forbidden verification").toString()).type(MediaType.APPLICATION_JSON).build();
|
398 |
|
|
}
|
399 |
|
|
} else {
|
400 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("User has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
401 |
|
|
}
|
402 |
|
|
} else {
|
403 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Verification has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
404 |
|
|
}
|
405 |
|
|
}
|
406 |
|
|
|
407 |
|
|
/**
|
408 |
59219
|
k.triantaf
|
* Remove the manager role from user with email for a type(Community, etc.) with id(ee, egi, etc.)
|
409 |
59337
|
k.triantaf
|
*/
|
410 |
59219
|
k.triantaf
|
@Path("/{type}/{id}/manager/{email}")
|
411 |
|
|
@DELETE
|
412 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
413 |
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
414 |
59923
|
k.triantaf
|
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
|
415 |
59219
|
k.triantaf
|
public Response removeManagerRole(@PathParam("type") String type, @PathParam("id") String
|
416 |
|
|
id, @PathParam("email") String email) {
|
417 |
60716
|
k.triantaf
|
List<Integer> coPersonIds = calls.getCoPersonIdsByEmail(email);
|
418 |
|
|
if (coPersonIds.size() > 0) {
|
419 |
59219
|
k.triantaf
|
Integer couId = calls.getCouId(type, id);
|
420 |
|
|
if (couId != null) {
|
421 |
60716
|
k.triantaf
|
coPersonIds.forEach(coPersonId -> {
|
422 |
|
|
calls.removeAdminRole(coPersonId, couId);
|
423 |
|
|
});
|
424 |
59851
|
k.triantaf
|
authoritiesUpdater.update(email, old -> {
|
425 |
|
|
HashSet<SimpleGrantedAuthority> authorities = new HashSet<>((Collection<? extends SimpleGrantedAuthority>) old);
|
426 |
|
|
authorities.remove(new SimpleGrantedAuthority(authorizationService.manager(type, id)));
|
427 |
|
|
return authorities;
|
428 |
|
|
});
|
429 |
59219
|
k.triantaf
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse("Role has been removed").toString()).type(MediaType.APPLICATION_JSON).build();
|
430 |
|
|
} else {
|
431 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
432 |
|
|
}
|
433 |
|
|
} else {
|
434 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("User has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
435 |
|
|
}
|
436 |
|
|
}
|
437 |
|
|
|
438 |
|
|
/**
|
439 |
59502
|
k.triantaf
|
* Remove the member role from user with email for a type(Community, etc.) with id(ee, egi, etc.)
|
440 |
59337
|
k.triantaf
|
*/
|
441 |
59502
|
k.triantaf
|
@Path("/{type}/{id}/member/{email}")
|
442 |
|
|
@DELETE
|
443 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
444 |
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
445 |
59923
|
k.triantaf
|
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN, @AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
|
446 |
59502
|
k.triantaf
|
public Response removeMemberRole(@PathParam("type") String type, @PathParam("id") String
|
447 |
|
|
id, @PathParam("email") String email) {
|
448 |
60716
|
k.triantaf
|
List<Integer> coPersonIds = calls.getCoPersonIdsByEmail(email);
|
449 |
|
|
if (coPersonIds.size() > 0) {
|
450 |
60483
|
katerina.i
|
Integer couId = calls.getCouId(type, id, false);
|
451 |
60716
|
k.triantaf
|
if (couId != null) {
|
452 |
|
|
coPersonIds.forEach(coPersonId -> {
|
453 |
|
|
Integer role = calls.getRoleId(coPersonId, couId);
|
454 |
|
|
calls.removeAdminRole(coPersonId, couId);
|
455 |
|
|
calls.removeMemberRole(coPersonId, couId, role);
|
456 |
|
|
});
|
457 |
59851
|
k.triantaf
|
authoritiesUpdater.update(email, old -> {
|
458 |
|
|
HashSet<SimpleGrantedAuthority> authorities = new HashSet<>((Collection<? extends SimpleGrantedAuthority>) old);
|
459 |
|
|
authorities.remove(new SimpleGrantedAuthority(authorizationService.manager(type, id)));
|
460 |
|
|
authorities.remove(new SimpleGrantedAuthority(authorizationService.member(type, id)));
|
461 |
|
|
return authorities;
|
462 |
|
|
});
|
463 |
59502
|
k.triantaf
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse("Role has been removed").toString()).type(MediaType.APPLICATION_JSON).build();
|
464 |
|
|
} else {
|
465 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
466 |
|
|
}
|
467 |
|
|
} else {
|
468 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("User has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
469 |
|
|
}
|
470 |
|
|
}
|
471 |
|
|
|
472 |
|
|
/**
|
473 |
|
|
* Get the names of the members of a type(Community, etc.) with id(ee, egi, etc.)
|
474 |
|
|
*/
|
475 |
|
|
@Path("/{type}/{id}/members")
|
476 |
59219
|
k.triantaf
|
@GET
|
477 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
478 |
59923
|
k.triantaf
|
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN," +
|
479 |
59345
|
k.triantaf
|
"@AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
|
480 |
59502
|
k.triantaf
|
public Response getMembers(@PathParam("type") String type, @PathParam("id") String id) {
|
481 |
60716
|
k.triantaf
|
Integer couId = calls.getCouId(type, id, false);
|
482 |
|
|
if (couId != null) {
|
483 |
59828
|
k.triantaf
|
JsonArray members = calls.getUserNamesByCouId(couId, false);
|
484 |
59763
|
k.triantaf
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(members).toString()).type(MediaType.APPLICATION_JSON).build();
|
485 |
|
|
} else {
|
486 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
487 |
|
|
}
|
488 |
59219
|
k.triantaf
|
}
|
489 |
|
|
|
490 |
|
|
/**
|
491 |
59502
|
k.triantaf
|
* Get the emails of the members of a type(Community, etc.) with id(ee, egi, etc.)
|
492 |
59337
|
k.triantaf
|
*/
|
493 |
59502
|
k.triantaf
|
@Path("/{type}/{id}/members/email")
|
494 |
59219
|
k.triantaf
|
@GET
|
495 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
496 |
59923
|
k.triantaf
|
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN," +
|
497 |
59345
|
k.triantaf
|
"@AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
|
498 |
59502
|
k.triantaf
|
public Response getMembersEmail(@PathParam("type") String type, @PathParam("id") String id) {
|
499 |
60483
|
katerina.i
|
Integer couId = calls.getCouId(type, id, false);
|
500 |
60716
|
k.triantaf
|
if (couId != null) {
|
501 |
59828
|
k.triantaf
|
JsonArray members = calls.getUserEmailByCouId(couId, false);
|
502 |
59763
|
k.triantaf
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(members).toString()).type(MediaType.APPLICATION_JSON).build();
|
503 |
|
|
} else {
|
504 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
505 |
|
|
}
|
506 |
59219
|
k.triantaf
|
}
|
507 |
|
|
|
508 |
|
|
/**
|
509 |
60716
|
k.triantaf
|
* Get the Identifiers of the members of a type(Community, etc.) with id(ee, egi, etc.)
|
510 |
|
|
*/
|
511 |
|
|
@Path("/{type}/{id}/members/id")
|
512 |
|
|
@GET
|
513 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
514 |
|
|
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN," +
|
515 |
|
|
"@AuthorizationService.curator(#type), @AuthorizationService.manager(#type, #id))")
|
516 |
|
|
public Response getMembersId(@PathParam("type") String type, @PathParam("id") String id) {
|
517 |
|
|
Integer couId = calls.getCouId(type, id, false);
|
518 |
|
|
if (couId != null) {
|
519 |
|
|
JsonArray members = calls.getUserIdByCouId(couId, false);
|
520 |
|
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(members).toString()).type(MediaType.APPLICATION_JSON).build();
|
521 |
|
|
} else {
|
522 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
523 |
|
|
}
|
524 |
|
|
}
|
525 |
|
|
|
526 |
|
|
/**
|
527 |
59502
|
k.triantaf
|
* Get the number of the members of a type(Community, etc.) with id(ee, egi, etc.)
|
528 |
59337
|
k.triantaf
|
*/
|
529 |
59502
|
k.triantaf
|
@Path("/{type}/{id}/members/count")
|
530 |
59219
|
k.triantaf
|
@GET
|
531 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
532 |
59502
|
k.triantaf
|
public Response getMembersCount(@PathParam("type") String type, @PathParam("id") String id) {
|
533 |
60483
|
katerina.i
|
Integer couId = calls.getCouId(type, id, false);
|
534 |
59763
|
k.triantaf
|
int count = 0;
|
535 |
60716
|
k.triantaf
|
if (couId != null) {
|
536 |
59763
|
k.triantaf
|
count = calls.getUserNamesByCouId(couId, false).size();
|
537 |
|
|
}
|
538 |
59219
|
k.triantaf
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(count).toString()).type(MediaType.APPLICATION_JSON).build();
|
539 |
|
|
}
|
540 |
|
|
|
541 |
|
|
/**
|
542 |
|
|
* Get the names of the managers of a type(Community, etc.) with id(ee, egi, etc.)
|
543 |
59337
|
k.triantaf
|
*/
|
544 |
59219
|
k.triantaf
|
@Path("/{type}/{id}/managers")
|
545 |
|
|
@GET
|
546 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
547 |
|
|
public Response getManagers(@PathParam("type") String type, @PathParam("id") String id) {
|
548 |
|
|
Integer couId = calls.getCouId(type, id);
|
549 |
60716
|
k.triantaf
|
if (couId != null) {
|
550 |
59763
|
k.triantaf
|
JsonArray managers = calls.getUserNamesByCouId(couId, true);
|
551 |
|
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(managers).toString()).type(MediaType.APPLICATION_JSON).build();
|
552 |
|
|
} else {
|
553 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
554 |
|
|
}
|
555 |
59219
|
k.triantaf
|
}
|
556 |
|
|
|
557 |
|
|
/**
|
558 |
|
|
* Get the emails of the managers of a type(Community, etc.) with id(ee, egi, etc.)
|
559 |
59337
|
k.triantaf
|
*/
|
560 |
59219
|
k.triantaf
|
@Path("/{type}/{id}/managers/email")
|
561 |
|
|
@GET
|
562 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
563 |
|
|
public Response getManagersEmail(@PathParam("type") String type, @PathParam("id") String id) {
|
564 |
|
|
Integer couId = calls.getCouId(type, id);
|
565 |
60716
|
k.triantaf
|
if (couId != null) {
|
566 |
59763
|
k.triantaf
|
JsonArray managers = calls.getUserEmailByCouId(couId, true);
|
567 |
|
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(managers).toString()).type(MediaType.APPLICATION_JSON).build();
|
568 |
|
|
} else {
|
569 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
570 |
|
|
}
|
571 |
59219
|
k.triantaf
|
}
|
572 |
60716
|
k.triantaf
|
|
573 |
|
|
/**
|
574 |
|
|
* Get the Identifiers of the managers of a type(Community, etc.) with id(ee, egi, etc.)
|
575 |
|
|
*/
|
576 |
|
|
@Path("/{type}/{id}/managers/id")
|
577 |
|
|
@GET
|
578 |
|
|
@Produces(MediaType.APPLICATION_JSON)
|
579 |
|
|
public Response getManagersId(@PathParam("type") String type, @PathParam("id") String id) {
|
580 |
|
|
Integer couId = calls.getCouId(type, id);
|
581 |
|
|
if (couId != null) {
|
582 |
|
|
JsonArray managers = calls.getUserIdByCouId(couId, true);
|
583 |
|
|
return Response.status(HttpStatus.OK.value()).entity(jsonUtils.createResponse(managers).toString()).type(MediaType.APPLICATION_JSON).build();
|
584 |
|
|
} else {
|
585 |
|
|
return Response.status(HttpStatus.NOT_FOUND.value()).entity(jsonUtils.createResponse("Role has not been found").toString()).type(MediaType.APPLICATION_JSON).build();
|
586 |
|
|
}
|
587 |
|
|
}
|
588 |
59219
|
k.triantaf
|
}
|