Compare commits

..

41 Commits
master ... beta

Author SHA1 Message Date
Konstantinos Triantafyllou 935a03dafd [maven-release-plugin] prepare for next development iteration 2024-04-24 23:24:25 +03:00
Konstantinos Triantafyllou ab661e7408 [maven-release-plugin] prepare release uoa-monitor-service-1.1.12-BETA 2024-04-24 23:24:20 +03:00
Konstantinos Triantafyllou 2423d6ce60 Merge remote-tracking branch 'origin/master' into beta 2024-04-24 23:23:51 +03:00
Konstantinos Triantafyllou 5426c1bc7b [maven-release-plugin] prepare for next development iteration 2024-04-15 10:43:40 +03:00
Konstantinos Triantafyllou f0fc81b27a [maven-release-plugin] prepare release uoa-monitor-service-1.1.11-BETA 2024-04-15 10:43:36 +03:00
Konstantinos Triantafyllou 409ec76b67 Merge remote-tracking branch 'origin/master' into beta 2024-04-15 10:43:03 +03:00
Konstantinos Triantafyllou 095058e45b [maven-release-plugin] prepare for next development iteration 2024-03-12 17:58:15 +02:00
Konstantinos Triantafyllou 3d757fc2d2 [maven-release-plugin] prepare release uoa-monitor-service-1.1.10-BETA 2024-03-12 17:58:11 +02:00
Konstantinos Triantafyllou cc59982d8a Merge remote-tracking branch 'origin/master' into beta 2024-03-12 17:57:07 +02:00
Konstantinos Triantafyllou ed0626032f [maven-release-plugin] prepare for next development iteration 2024-02-20 09:30:29 +02:00
Konstantinos Triantafyllou 73d8f2cc95 [maven-release-plugin] prepare release uoa-monitor-service-1.1.9-BETA 2024-02-20 09:30:25 +02:00
Konstantinos Triantafyllou 78680d933c Merge remote-tracking branch 'origin/master' into beta 2024-02-20 09:30:04 +02:00
Konstantinos Triantafyllou c3e452d9bd [maven-release-plugin] prepare for next development iteration 2024-02-20 09:11:17 +02:00
Konstantinos Triantafyllou 8b89929622 [maven-release-plugin] prepare release uoa-monitor-service-1.1.8-BETA 2024-02-20 09:11:13 +02:00
Konstantinos Triantafyllou b727c07970 [maven-release-plugin] prepare for next development iteration 2023-12-21 15:30:38 +02:00
Konstantinos Triantafyllou ba4eac5f60 [maven-release-plugin] prepare release uoa-monitor-service-1.1.7-BETA 2023-12-21 15:30:33 +02:00
Konstantinos Triantafyllou c82a393e1e Merge remote-tracking branch 'origin/irish-monitor-service' into beta 2023-12-21 15:30:09 +02:00
Konstantinos Triantafyllou 5e213020b4 [maven-release-plugin] prepare for next development iteration 2023-11-14 13:22:10 +02:00
Konstantinos Triantafyllou a0584f2010 [maven-release-plugin] prepare release uoa-monitor-service-1.1.6-BETA 2023-11-14 13:22:07 +02:00
Konstantinos Triantafyllou 51bdeb5e1e Merge remote-tracking branch 'origin/master' into beta 2023-11-14 13:21:28 +02:00
Konstantinos Triantafyllou 075ecab118 [maven-release-plugin] prepare for next development iteration 2023-07-31 10:59:54 +03:00
Konstantinos Triantafyllou 65a4e8d3fe [maven-release-plugin] prepare release uoa-monitor-service-1.1.5-BETA 2023-07-31 10:59:50 +03:00
Konstantinos Triantafyllou 3c3c4295dc Merge remote-tracking branch 'origin/master' into beta 2023-07-31 10:59:25 +03:00
Konstantinos Triantafyllou c4805df822 [maven-release-plugin] prepare for next development iteration 2023-07-27 16:11:06 +03:00
Konstantinos Triantafyllou 14a0add458 [maven-release-plugin] prepare release uoa-monitor-service-1.1.4-BETA 2023-07-27 16:11:02 +03:00
Konstantinos Triantafyllou 36675ce12d Merge remote-tracking branch 'origin/master' into beta 2023-07-27 16:09:19 +03:00
Konstantinos Triantafyllou e6e8eb283f [maven-release-plugin] prepare for next development iteration 2023-07-04 16:04:19 +03:00
Konstantinos Triantafyllou fb3812db5c [maven-release-plugin] prepare release uoa-monitor-service-1.1.3-BETA 2023-07-04 16:04:15 +03:00
Konstantinos Triantafyllou e61d90fd9c Merge remote-tracking branch 'origin/master' into beta 2023-07-04 16:03:42 +03:00
Konstantinos Triantafyllou f036f7c98d [maven-release-plugin] prepare for next development iteration 2023-06-20 14:23:43 +03:00
Konstantinos Triantafyllou a95b9cecd5 [maven-release-plugin] prepare release uoa-monitor-service-1.1.2-BETA 2023-06-20 14:23:40 +03:00
Konstantinos Triantafyllou 0150975600 Merge remote-tracking branch 'origin/master' into beta 2023-06-20 14:22:34 +03:00
Konstantinos Triantafyllou 15b16613bf Merge remote-tracking branch 'origin/master' into beta 2023-05-31 16:27:36 +03:00
Konstantinos Triantafyllou b365e713e7 [maven-release-plugin] prepare for next development iteration 2023-05-30 16:29:20 +03:00
Konstantinos Triantafyllou fc37faa83d [maven-release-plugin] prepare release uoa-monitor-service-1.1.1-BETA 2023-05-30 16:29:16 +03:00
Konstantinos Triantafyllou 2e86ddca90 Merge branch 'master' into beta 2023-05-30 16:27:15 +03:00
Konstantina Galouni 6cbda6babc Merge pull request 'master' (#1) from master into beta
Reviewed-on: #1
2023-05-03 12:07:48 +02:00
Konstantinos Triantafyllou d3782a1fe9 [maven-release-plugin] prepare for next development iteration 2022-10-20 10:57:53 +03:00
Konstantinos Triantafyllou d85cdb8c23 [maven-release-plugin] prepare release uoa-monitor-service-1.1.0-BETA 2022-10-20 10:57:50 +03:00
Konstantinos Triantafyllou 07dd7d4ca7 Merge remote-tracking branch 'origin/log4j2' into beta 2022-10-20 10:57:20 +03:00
Konstantina Galouni ea7f71f0ab Configure beta pom (added -BETA- in version) 2022-10-10 15:31:15 +03:00
13 changed files with 71 additions and 92 deletions

View File

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>uoa-monitor-service</artifactId>
<version>1.0.4-SNAPSHOT</version>
<version>1.1.13-BETA-SNAPSHOT</version>
<packaging>war</packaging>
<name>uoa-monitor-service</name>
<scm>
<developerConnection>scm:git:gitea@code-repo.d4science.org:MaDgIK/uoa-monitor-service.git</developerConnection>
<tag>HEAD</tag>
</scm>
<parent>
<groupId>eu.dnetlib</groupId>
@ -30,7 +29,7 @@
<dependency> <!-- this dependency includes dependency to uoa-authorization-library -->
<groupId>eu.dnetlib</groupId>
<artifactId>uoa-admin-tools-library</artifactId>
<version>1.0.12</version>
<version>1.0.10</version>
</dependency>
<dependency>
<groupId>eu.dnetlib</groupId>

View File

@ -234,6 +234,8 @@ function uniqueIndexes() {
db.stakeholder.createIndex( { "alias": 1 }, { unique: true } );
}
// use monitordb;
upperCaseEnumValues();
addHeightInIndicators();
addVisibility();

View File

@ -52,6 +52,8 @@ function addFooterHelpTextForPortalType(portalType) {
}
}
// use monitordb;
addHomePageInPortalType("funder");
addFooterDivIdForPortalType("funder");
addFooterHelpTextForPortalType("funder");

View File

@ -176,5 +176,7 @@ function addFundingStreamInDefaultMSCA() {
}
}
// use monitordb;
statsProfileOfIndicatorsAsVariable();
addFundingStreamInDefaultMSCA();

View File

@ -12,12 +12,5 @@ function deleteIndexParameters() {
})
}
function addCopyWithDefaultValue() {
/* Set default profiles with copy: false */
db.stakeholder.updateMany({defaultId: null, copy: {$exists: false}}, {$set: {copy: false}});
/* Set not default profiles with copy: true */
db.stakeholder.updateMany({defaultId: {$ne: null}, copy: {$exists: false}}, {$set: {copy: true}});
}
// use irish-prod;
deleteIndexParameters();
addCopyWithDefaultValue();

View File

@ -1,12 +1,13 @@
package eu.dnetlib.uoamonitorservice.controllers;
import eu.dnetlib.uoaadmintoolslibrary.entities.Portal;
import eu.dnetlib.uoaadmintoolslibrary.handlers.ForbiddenException;
import eu.dnetlib.uoaadmintoolslibrary.services.PortalService;
import eu.dnetlib.uoamonitorservice.dto.StakeholderFull;
import eu.dnetlib.uoamonitorservice.dto.copy;
import eu.dnetlib.uoamonitorservice.dto.StakeholderFull;
import eu.dnetlib.uoamonitorservice.entities.Stakeholder;
import eu.dnetlib.uoamonitorservice.generics.StakeholderGeneric;
import eu.dnetlib.uoamonitorservice.primitives.Visibility;
import eu.dnetlib.uoamonitorservice.service.CommonService;
import eu.dnetlib.uoamonitorservice.service.StakeholderService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -15,6 +16,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@CrossOrigin(origins = "*")
@ -23,13 +25,11 @@ public class StakeholderController {
private final PortalService portalService;
private final StakeholderService stakeholderService;
private final CommonService commonService;
@Autowired
public StakeholderController(PortalService portalService, StakeholderService stakeholderService, CommonService commonService) {
public StakeholderController(PortalService portalService, StakeholderService stakeholderService) {
this.portalService = portalService;
this.stakeholderService = stakeholderService;
this.commonService = commonService;
}
@PreAuthorize("isAuthenticated()")
@ -89,7 +89,7 @@ public class StakeholderController {
public StakeholderFull getStakeholder(@PathVariable("alias") String alias) {
StakeholderFull stakeholder = this.stakeholderService.getFullStakeholder(this.stakeholderService.findByAlias(alias));
if (stakeholder == null) {
this.commonService.unauthorized("Get stakeholder: You are not authorized to access stakeholder with alias: " + alias);
throw new ForbiddenException("Get stakeholder: You are not authorized to access stakeholder with alias: " + alias);
}
return stakeholder;
}

View File

@ -102,7 +102,7 @@ public class CategoryService {
this.updateChildren(category);
category = this.save(category);
} else {
this.commonService.unauthorized("You are not authorized to update stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("You are not authorized to update stakeholder with id: " + stakeholder.getId());
}
} else {
if (this.commonService.hasCreateAuthority(stakeholder.getType())) {
@ -113,7 +113,7 @@ public class CategoryService {
}
this.addCategory(topic, category.getId());
} else {
this.commonService.unauthorized("You are not authorized to create a category in stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("You are not authorized to create a category in stakeholder with id: " + stakeholder.getId());
}
}
return this.getFullCategory(stakeholder.getType(), stakeholder.getAlias(), category);
@ -145,9 +145,8 @@ public class CategoryService {
throw new EntityNotFoundException("Some subCategories dont exist in the category with id " + category.getId());
}
} else {
this.commonService.unauthorized("You are not authorized to reorder subCategories in category with id: " + category.getId());
throw new ForbiddenException("You are not authorized to reorder subCategories in category with id: " + category.getId());
}
return null;
}
public void reorderChildren(Stakeholder defaultStakeholder, Category defaultCategory, List<String> defaultSubCategories) {
@ -172,7 +171,7 @@ public class CategoryService {
}
this.dao.delete(category);
} else {
this.commonService.unauthorized("Delete category: You are not authorized to delete category with id: " + category.getId());
throw new ForbiddenException("Delete category: You are not authorized to delete category with id: " + category.getId());
}
}
@ -206,9 +205,8 @@ public class CategoryService {
category.update(this.save(new Category(category)));
return category;
} else {
this.commonService.unauthorized("Change category visibility: You are not authorized to update category with id: " + category.getId());
throw new ForbiddenException("Change category visibility: You are not authorized to update category with id: " + category.getId());
}
return null;
}
public CategoryFull changeVisibility(String type, String alias, Category category, Visibility visibility, Boolean propagate) {

View File

@ -1,7 +1,5 @@
package eu.dnetlib.uoamonitorservice.service;
import eu.dnetlib.uoaadmintoolslibrary.handlers.ForbiddenException;
import eu.dnetlib.uoaadmintoolslibrary.handlers.UnauthorizedException;
import eu.dnetlib.uoaauthorizationlibrary.security.AuthorizationService;
import eu.dnetlib.uoamonitorservice.dto.TopicFull;
import eu.dnetlib.uoamonitorservice.generics.Common;
@ -71,12 +69,4 @@ public class CommonService {
});
return ids;
}
public void unauthorized(String message) {
if(authorizationService.getAaiId() != null) {
throw new ForbiddenException(message);
} else {
throw new UnauthorizedException(message);
}
}
}

View File

@ -1,5 +1,6 @@
package eu.dnetlib.uoamonitorservice.service;
import eu.dnetlib.uoaadmintoolslibrary.handlers.ForbiddenException;
import eu.dnetlib.uoamonitorservice.dao.*;
import eu.dnetlib.uoamonitorservice.entities.Indicator;
import eu.dnetlib.uoamonitorservice.entities.Section;
@ -81,7 +82,7 @@ public class IndicatorService {
this.updateChildren(indicator);
indicator = this.save(indicator);
} else {
this.commonService.unauthorized("You are not authorized to update stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("You are not authorized to update stakeholder with id: " + stakeholder.getId());
}
} else {
if (this.commonService.hasCreateAuthority(stakeholder.getType())) {
@ -89,7 +90,7 @@ public class IndicatorService {
this.createChildren(section, indicator);
this.addIndicator(section, indicator.getId());
} else {
this.commonService.unauthorized("You are not authorized to create an indicator in stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("You are not authorized to create an indicator in stakeholder with id: " + stakeholder.getId());
}
}
return indicator;
@ -127,7 +128,7 @@ public class IndicatorService {
}
this.dao.delete(indicator);
} else {
this.commonService.unauthorized("Delete indicator: You are not authorized to delete indicator with id: " + indicator.getId());
throw new ForbiddenException("Delete indicator: You are not authorized to delete indicator with id: " + indicator.getId());
}
}
@ -156,8 +157,7 @@ public class IndicatorService {
indicator.setVisibility(visibility);
return this.save(indicator);
} else {
this.commonService.unauthorized("Change section visibility: You are not authorized to update section with id: " + indicator.getId());
throw new ForbiddenException("Change section visibility: You are not authorized to update section with id: " + indicator.getId());
}
return null;
}
}

View File

@ -103,7 +103,7 @@ public class SectionService {
this.createChildren(subCategory, new Section(section), -1);
});
} else {
this.commonService.unauthorized("You are not authorized to create sections in stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("You are not authorized to create sections in stakeholder with id: " + stakeholder.getId());
}
}
@ -115,7 +115,7 @@ public class SectionService {
this.updateChildren(section);
section = this.save(section);
} else {
this.commonService.unauthorized("You are not authorized to update stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("You are not authorized to update stakeholder with id: " + stakeholder.getId());
}
} else {
if (this.commonService.hasCreateAuthority(stakeholder.getType())) {
@ -123,7 +123,7 @@ public class SectionService {
this.createChildren(subCategory, section, index);
this.addSection(subCategory, section.getId(), index);
} else {
this.commonService.unauthorized("You are not authorized to create a section in stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("You are not authorized to create a section in stakeholder with id: " + stakeholder.getId());
}
}
return this.getFullSection(stakeholder.getType(), stakeholder.getAlias(), section);
@ -168,9 +168,8 @@ public class SectionService {
throw new EntityNotFoundException("Some indicators dont exist in the section with id " + section.getId());
}
} else {
this.commonService.unauthorized("You are not authorized to reorder indicators in section with id: " + section.getId());
throw new ForbiddenException("You are not authorized to reorder indicators in section with id: " + section.getId());
}
return null;
}
public void reorderChildren(Stakeholder defaultStakeholder, Section defaultSection, List<String> defaultIndicators) {
@ -195,7 +194,7 @@ public class SectionService {
}
this.dao.delete(section);
} else {
this.commonService.unauthorized("Delete section: You are not authorized to delete section with id: " + section.getId());
throw new ForbiddenException("Delete section: You are not authorized to delete section with id: " + section.getId());
}
}
@ -239,8 +238,7 @@ public class SectionService {
section.update(this.save(new Section(section)));
return section;
} else {
this.commonService.unauthorized("Change section visibility: You are not authorized to update section with id: " + section.getId());
throw new ForbiddenException("Change section visibility: You are not authorized to update section with id: " + section.getId());
}
return null;
}
}

View File

@ -40,7 +40,7 @@ public class StakeholderService {
}
public Stakeholder findByPath(String stakeholderId) {
if (stakeholderId.equals("-1")) {
if(stakeholderId.equals("-1")) {
return null;
}
return dao.findById(stakeholderId).orElseThrow(() -> new EntityNotFoundException("Stakeholder with id: " + stakeholderId + " not found"));
@ -81,9 +81,10 @@ public class StakeholderService {
}
public StakeholderFull getFullStakeholder(Stakeholder stakeholder) {
if (!stakeholder.isCopy() && stakeholder.getDefaultId() != null) {
if (this.commonService.hasVisibilityAuthority(stakeholder.getType(), stakeholder.getAlias(), stakeholder)) {
if(!stakeholder.isCopy() && stakeholder.getDefaultId() != null) {
Stakeholder defaultStakeholder = this.findByPath(stakeholder.getDefaultId());
if (defaultStakeholder != null) {
if(defaultStakeholder != null) {
return new StakeholderFull(stakeholder,
defaultStakeholder.getTopics().stream()
.map(topicId -> topicService.getFullTopic(stakeholder.getType(), stakeholder.getAlias(), topicId))
@ -94,12 +95,15 @@ public class StakeholderService {
stakeholder.getTopics().stream()
.map(topicId -> topicService.getFullTopic(stakeholder.getType(), stakeholder.getAlias(), topicId))
.collect(Collectors.toList()));
} else {
return null;
}
}
public Stakeholder buildStakeholder(Stakeholder stakeholder, String copyId) {
if (stakeholder.getDefaultId() == null) {
if(stakeholder.getDefaultId() == null) {
stakeholder.setCopy(false);
if (copyId == null) {
if(copyId == null) {
stakeholder.setTopics(new ArrayList<>());
} else {
Stakeholder copyFrom = this.findByPath(copyId);
@ -107,9 +111,9 @@ public class StakeholderService {
}
} else {
stakeholder.setTopics(new ArrayList<>());
if (stakeholder.isCopy()) {
if(stakeholder.isCopy()) {
Stakeholder defaultStakeholder = this.findByPath(stakeholder.getDefaultId());
if (defaultStakeholder != null) {
if(defaultStakeholder != null) {
stakeholder.setTopics(defaultStakeholder.getTopics().stream().map(this.topicService::build).collect(Collectors.toList()));
}
}
@ -127,9 +131,9 @@ public class StakeholderService {
});
stakeholder.setTopics(new ArrayList<>());
} else {
if (old.getTopics().isEmpty() && old.getDefaultId() != null) {
if(old.getTopics().isEmpty() && old.getDefaultId() != null) {
Stakeholder defaultStakeholder = this.findByPath(stakeholder.getDefaultId());
if (defaultStakeholder != null) {
if(defaultStakeholder != null) {
stakeholder.setTopics(defaultStakeholder.getTopics().stream().map(this.topicService::build).collect(Collectors.toList()));
}
}
@ -154,9 +158,8 @@ public class StakeholderService {
throw new EntityNotFoundException("Some topics dont exist in the stakeholder with id " + stakeholder.getId());
}
} else {
this.commonService.unauthorized("You are not authorized to reorder topics in stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("You are not authorized to reorder topics in stakeholder with id: " + stakeholder.getId());
}
return null;
}
public void reorderChildren(Stakeholder defaultStakeholder, List<String> defaultTopics) {
@ -178,9 +181,8 @@ public class StakeholderService {
this.dao.delete(id);
return stakeholder.getAlias();
} else {
this.commonService.unauthorized("Delete stakeholder: You are not authorized to delete stakeholder with id: " + id);
throw new ForbiddenException("Delete stakeholder: You are not authorized to delete stakeholder with id: " + id);
}
return null;
}
public StakeholderFull changeVisibility(StakeholderFull stakeholder, Visibility visibility, Boolean propagate) {
@ -194,9 +196,8 @@ public class StakeholderService {
stakeholder.update(this.save(new Stakeholder(stakeholder)));
return stakeholder;
} else {
this.commonService.unauthorized("Change stakeholder visibility: You are not authorized to update stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("Change stakeholder visibility: You are not authorized to update stakeholder with id: " + stakeholder.getId());
}
return null;
}
public StakeholderFull changeVisibility(Stakeholder stakeholder, Visibility visibility, Boolean propagate) {

View File

@ -112,7 +112,7 @@ public class SubCategoryService {
this.updateChildren(subCategory);
subCategory = this.save(subCategory);
} else {
this.commonService.unauthorized("You are not authorized to update stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("You are not authorized to update stakeholder with id: " + stakeholder.getId());
}
} else {
if (this.commonService.hasCreateAuthority(stakeholder.getType())) {
@ -120,7 +120,7 @@ public class SubCategoryService {
this.createChildren(category, subCategory);
this.addSubCategory(category, subCategory.getId());
} else {
this.commonService.unauthorized("You are not authorized to create a subCategory in stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("You are not authorized to create a subCategory in stakeholder with id: " + stakeholder.getId());
}
}
return this.getFullSubCategory(stakeholder.getType(), stakeholder.getAlias(), subCategory);
@ -153,9 +153,8 @@ public class SubCategoryService {
this.moveIndicatorChildren(stakeholder, subCategory, moveIndicator);
return this.getFullSubCategory(stakeholder.getType(), stakeholder.getAlias(), subCategory);
} else {
this.commonService.unauthorized("You are not authorized to move indicators in subCategory with id: " + subCategory.getId());
throw new ForbiddenException("You are not authorized to move indicators in subCategory with id: " + subCategory.getId());
}
return null;
}
public void moveIndicatorChildren(Stakeholder defaultStakeholder, SubCategory defaultSubCategory, MoveIndicator moveIndicator) {
@ -192,9 +191,8 @@ public class SubCategoryService {
throw new EntityNotFoundException("Some sections dont exist in the subCategory with id " + subCategory.getId());
}
} else {
this.commonService.unauthorized("You are not authorized to reorder sections in subCategory with id: " + subCategory.getId());
throw new ForbiddenException("You are not authorized to reorder sections in subCategory with id: " + subCategory.getId());
}
return null;
}
public SubCategoryFull reorderCharts(Stakeholder stakeholder, SubCategory subCategory, List<String> charts) {
@ -208,9 +206,8 @@ public class SubCategoryService {
throw new EntityNotFoundException("Some sections dont exist in the subCategory with id " + subCategory.getId());
}
} else {
this.commonService.unauthorized("You are not authorized to reorder sections in subCategory with id: " + subCategory.getId());
throw new ForbiddenException("You are not authorized to reorder sections in subCategory with id: " + subCategory.getId());
}
return null;
}
public void reorderChildrenNumbers(Stakeholder defaultStakeholder, SubCategory defaultSubCategory, List<String> defaultSections) {
@ -248,7 +245,7 @@ public class SubCategoryService {
}
this.dao.delete(subCategory);
} else {
this.commonService.unauthorized("Delete subCategory: You are not authorized to delete subCategory with id: " + subCategory.getId());
throw new ForbiddenException("Delete subCategory: You are not authorized to delete subCategory with id: " + subCategory.getId());
}
}
@ -285,9 +282,8 @@ public class SubCategoryService {
subCategory.update(this.save(new SubCategory(subCategory)));
return subCategory;
} else {
this.commonService.unauthorized("Change subCategory visibility: You are not authorized to update subCategory with id: " + subCategory.getId());
throw new ForbiddenException("Change subCategory visibility: You are not authorized to update subCategory with id: " + subCategory.getId());
}
return null;
}
public SubCategoryFull changeVisibility(String type, String alias, SubCategory subCategory, Visibility visibility, Boolean propagate) {

View File

@ -94,7 +94,7 @@ public class TopicService {
this.updateChildren(topic);
topic = this.save(topic);
} else {
this.commonService.unauthorized("You are not authorized to update stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("You are not authorized to update stakeholder with id: " + stakeholder.getId());
}
} else {
if(this.commonService.hasCreateAuthority(stakeholder.getType())) {
@ -102,7 +102,7 @@ public class TopicService {
this.createChildren(stakeholder, topic);
this.addTopic(stakeholder, topic.getId());
} else {
this.commonService.unauthorized("You are not authorized to create a topic in stakeholder with id: " + stakeholder.getId());
throw new ForbiddenException("You are not authorized to create a topic in stakeholder with id: " + stakeholder.getId());
}
}
return this.getFullTopic(stakeholder.getType(), stakeholder.getAlias(), topic);
@ -132,9 +132,8 @@ public class TopicService {
throw new EntityNotFoundException("Some categories dont exist in the topic with id " + topic.getId());
}
} else {
this.commonService.unauthorized("You are not authorized to reorder categories in topic with id: " + topic.getId());
throw new ForbiddenException("You are not authorized to reorder categories in topic with id: " + topic.getId());
}
return null;
}
public void reorderChildren(Stakeholder defaultStakeholder, Topic defaultTopic, List<String> defaultCategories) {
@ -159,7 +158,7 @@ public class TopicService {
}
this.dao.delete(topic);
} else {
this.commonService.unauthorized("Delete topic: You are not authorized to delete topic with id: " + topic.getId());
throw new ForbiddenException("Delete topic: You are not authorized to delete topic with id: " + topic.getId());
}
}
@ -193,9 +192,8 @@ public class TopicService {
topic.update(this.save(new Topic(topic)));
return topic;
} else {
this.commonService.unauthorized("Change topic visibility: You are not authorized to update topic with id: " + topic.getId());
throw new ForbiddenException("Change topic visibility: You are not authorized to update topic with id: " + topic.getId());
}
return null;
}
public TopicFull changeVisibility(String type, String alias, Topic topic, Visibility visibility, Boolean propagate) {