|
|
@@ -9,6 +9,7 @@ import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
|
|
|
+import org.hibernate.annotations.Any;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
@@ -32,6 +33,7 @@ import es.uv.saic.service.InstanciaTascaService;
|
|
|
import es.uv.saic.service.OrganService;
|
|
|
import es.uv.saic.service.ProcesService;
|
|
|
import es.uv.saic.service.UsuariService;
|
|
|
+import es.uv.saic.service.UsuarisRolService;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/calendar")
|
|
|
@@ -50,6 +52,8 @@ public class CalendarController {
|
|
|
private InstanciaTascaService its;
|
|
|
@Autowired
|
|
|
private EmailService es;
|
|
|
+ @Autowired
|
|
|
+ private UsuarisRolService urs;
|
|
|
|
|
|
// POST para añadir un evento al calendario
|
|
|
@ResponseBody
|
|
|
@@ -140,7 +144,7 @@ public class CalendarController {
|
|
|
@RequestParam("titulacions") List<Integer> titulacions, @RequestParam String usuari) throws IOException, ParseException {
|
|
|
|
|
|
Usuari u = us.findByUsername(usuari);
|
|
|
- if(!u.isAdmin()) {
|
|
|
+ if(!urs.isAdminUser(u)) {
|
|
|
return null;
|
|
|
}
|
|
|
|