Revision 60509
Added by Konstantinos Triantafyllou about 3 years ago
CommunityController.java | ||
---|---|---|
6 | 6 |
import eu.dnetlib.uoaadmintools.services.StatisticsService; |
7 | 7 |
import eu.dnetlib.uoaadmintools.services.SubscriberService; |
8 | 8 |
import eu.dnetlib.uoaadmintoolslibrary.entities.Portal; |
9 |
import eu.dnetlib.uoaadmintoolslibrary.entities.fullEntities.*;
|
|
9 |
import eu.dnetlib.uoaadmintoolslibrary.entities.fullEntities.PortalResponse;
|
|
10 | 10 |
import eu.dnetlib.uoaadmintoolslibrary.handlers.ContentNotFoundException; |
11 |
import eu.dnetlib.uoaadmintoolslibrary.handlers.ForbiddenException; |
|
12 | 11 |
import eu.dnetlib.uoaadmintoolslibrary.handlers.MismatchingContentException; |
13 |
import eu.dnetlib.uoaadmintoolslibrary.handlers.utils.RolesUtils; |
|
14 | 12 |
import eu.dnetlib.uoaadmintoolslibrary.services.PortalService; |
13 |
import eu.dnetlib.uoaauthorizationlibrary.security.AuthorizationService; |
|
15 | 14 |
import org.apache.log4j.Logger; |
16 |
import org.springframework.web.bind.annotation.*; |
|
17 | 15 |
import org.springframework.beans.factory.annotation.Autowired; |
18 |
|
|
19 |
import java.util.*; |
|
20 | 16 |
import org.springframework.security.access.prepost.PreAuthorize; |
17 |
import org.springframework.web.bind.annotation.*; |
|
21 | 18 |
|
19 |
import java.util.List; |
|
20 |
|
|
22 | 21 |
@RestController |
23 | 22 |
@RequestMapping("/community") |
24 | 23 |
@CrossOrigin(origins = "*") |
... | ... | |
26 | 25 |
private final Logger log = Logger.getLogger(this.getClass()); |
27 | 26 |
|
28 | 27 |
@Autowired |
29 |
private RolesUtils rolesUtils;
|
|
28 |
private AuthorizationService authorizationService;
|
|
30 | 29 |
|
31 | 30 |
@Autowired |
32 | 31 |
private LayoutService layoutService; |
... | ... | |
96 | 95 |
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN)") |
97 | 96 |
@RequestMapping(value = "/delete", method = RequestMethod.POST) |
98 | 97 |
public Boolean deleteCommunities(@RequestBody List<String> portals) { |
99 |
List<String> roles = rolesUtils.getRoles();
|
|
98 |
List<String> roles = authorizationService.getRoles();
|
|
100 | 99 |
|
101 | 100 |
for (String id: portals) { |
102 | 101 |
Portal portal = portalService.getPortalById(id); |
Also available in: Unified diff
[Admin Tools | Trunk]: Add get managers method. Delete no needed files.