use of org.hisp.dhis.configuration.Configuration in project dhis2-core by dhis2.
the class ConfigurationController method removeSelfRegistrationRole.
@PreAuthorize("hasRole('ALL') or hasRole('F_SYSTEM_SETTING')")
@RequestMapping(value = "/selfRegistrationRole", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void removeSelfRegistrationRole() {
Configuration config = configurationService.getConfiguration();
config.setSelfRegistrationRole(null);
configurationService.setConfiguration(config);
}
use of org.hisp.dhis.configuration.Configuration in project dhis2-core by dhis2.
the class ConfigurationController method setFeedbackRecipients.
@PreAuthorize("hasRole('ALL') or hasRole('F_SYSTEM_SETTING')")
@RequestMapping(value = "/feedbackRecipients", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void setFeedbackRecipients(@RequestBody String uid) throws NotFoundException {
UserGroup group = identifiableObjectManager.get(UserGroup.class, uid);
if (group == null) {
throw new NotFoundException("User group", uid);
}
Configuration config = configurationService.getConfiguration();
config.setFeedbackRecipients(group);
configurationService.setConfiguration(config);
}
use of org.hisp.dhis.configuration.Configuration in project dhis2-core by dhis2.
the class ConfigurationController method setCorsWhitelist.
@SuppressWarnings("unchecked")
@PreAuthorize("hasRole('ALL') or hasRole('F_SYSTEM_SETTING')")
@RequestMapping(value = "/corsWhitelist", method = RequestMethod.POST, consumes = "application/json")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void setCorsWhitelist(@RequestBody String input) throws IOException {
Set<String> corsWhitelist = renderService.fromJson(input, Set.class);
Configuration config = configurationService.getConfiguration();
config.setCorsWhitelist(corsWhitelist);
configurationService.setConfiguration(config);
}
use of org.hisp.dhis.configuration.Configuration in project dhis2-core by dhis2.
the class ConfigurationController method setSelfRegistrationRole.
@PreAuthorize("hasRole('ALL') or hasRole('F_SYSTEM_SETTING')")
@RequestMapping(value = "/selfRegistrationRole", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void setSelfRegistrationRole(@RequestBody String uid) throws NotFoundException {
UserAuthorityGroup userGroup = identifiableObjectManager.get(UserAuthorityGroup.class, uid);
if (userGroup == null) {
throw new NotFoundException("User authority group", uid);
}
Configuration config = configurationService.getConfiguration();
config.setSelfRegistrationRole(userGroup);
configurationService.setConfiguration(config);
}
use of org.hisp.dhis.configuration.Configuration in project dhis2-core by dhis2.
the class ConfigurationController method setInfrastructuralDataElements.
@PreAuthorize("hasRole('ALL') or hasRole('F_SYSTEM_SETTING')")
@RequestMapping(value = "/infrastructuralDataElements", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void setInfrastructuralDataElements(@RequestBody String uid) throws NotFoundException {
DataElementGroup group = identifiableObjectManager.get(DataElementGroup.class, uid);
if (group == null) {
throw new NotFoundException("Data element group", uid);
}
Configuration config = configurationService.getConfiguration();
config.setInfrastructuralDataElements(group);
configurationService.setConfiguration(config);
}
Aggregations