权限问题修复
parent
35bdd1b7fc
commit
aa7be02b37
|
@ -56,11 +56,11 @@ public class KeycloakSecurityConfig extends KeycloakWebSecurityConfigurerAdapter
|
||||||
.antMatchers("/*.html", "/favicon.ico","/v2/api-docs", "/webjars/**", "/swagger-resources/**", "/*.js").permitAll()
|
.antMatchers("/*.html", "/favicon.ico","/v2/api-docs", "/webjars/**", "/swagger-resources/**", "/*.js").permitAll()
|
||||||
.antMatchers("/api/**").hasRole("iot_client_user")
|
.antMatchers("/api/**").hasRole("iot_client_user")
|
||||||
.antMatchers("/aligenieDevice/invoke/**").hasRole("iot_client_user")
|
.antMatchers("/aligenieDevice/invoke/**").hasRole("iot_client_user")
|
||||||
.antMatchers("/**/save*").hasRole("iot_write")
|
.antMatchers("/**/save*/**").hasRole("iot_write")
|
||||||
.antMatchers("/**/del*").hasRole("iot_write")
|
.antMatchers("/**/del*/**").hasRole("iot_write")
|
||||||
.antMatchers("/**/add*").hasRole("iot_write")
|
.antMatchers("/**/add*/**").hasRole("iot_write")
|
||||||
.antMatchers("/**/clear*").hasRole("iot_write")
|
.antMatchers("/**/clear*/**").hasRole("iot_write")
|
||||||
.antMatchers("/**/set*").hasRole("iot_write")
|
.antMatchers("/**/set*/**").hasRole("iot_write")
|
||||||
.antMatchers("/**").hasAnyRole(systemRole)
|
.antMatchers("/**").hasAnyRole(systemRole)
|
||||||
.and().csrf().disable();
|
.and().csrf().disable();
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ public class DeviceController {
|
||||||
.build())).orElse(new DeviceInfo()));
|
.build())).orElse(new DeviceInfo()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/{deviceId}")
|
@PostMapping("/{deviceId}/delete")
|
||||||
public void deleteDevice(@PathVariable("deviceId") String deviceId) {
|
public void deleteDevice(@PathVariable("deviceId") String deviceId) {
|
||||||
deviceId = getDetail(deviceId).getDeviceId();
|
deviceId = getDetail(deviceId).getDeviceId();
|
||||||
deviceRepository.deleteById(deviceId);
|
deviceRepository.deleteById(deviceId);
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class ProductController {
|
||||||
thingModelRepository.save(new ThingModel(productKey, productKey, JsonUtil.parse(model, ThingModel.Model.class)));
|
thingModelRepository.save(new ThingModel(productKey, productKey, JsonUtil.parse(model, ThingModel.Model.class)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/thingModel/{productKey}")
|
@PostMapping("/thingModel/{productKey}/delete")
|
||||||
public void deleteThingModel(String productKey) {
|
public void deleteThingModel(String productKey) {
|
||||||
productKey = getProduct(productKey).getId();
|
productKey = getProduct(productKey).getId();
|
||||||
thingModelRepository.deleteById(productKey);
|
thingModelRepository.deleteById(productKey);
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class ProtocolController {
|
||||||
public void saveComponentScript(
|
public void saveComponentScript(
|
||||||
@PathVariable("id") String id,
|
@PathVariable("id") String id,
|
||||||
@RequestBody String script) {
|
@RequestBody String script) {
|
||||||
ProtocolComponent oldComponent = getAndCheckComponent(id);
|
getAndCheckComponent(id);
|
||||||
try {
|
try {
|
||||||
Path path = componentConfig.getComponentFilePath(id);
|
Path path = componentConfig.getComponentFilePath(id);
|
||||||
File file = path.resolve(ProtocolComponent.SCRIPT_FILE_NAME).toFile();
|
File file = path.resolve(ProtocolComponent.SCRIPT_FILE_NAME).toFile();
|
||||||
|
@ -145,7 +145,6 @@ public class ProtocolController {
|
||||||
FileUtils.writeStringToFile(file, script, "UTF-8", false);
|
FileUtils.writeStringToFile(file, script, "UTF-8", false);
|
||||||
|
|
||||||
componentManager.deRegister(id);
|
componentManager.deRegister(id);
|
||||||
protocolComponentRepository.save(oldComponent);
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
throw new BizException("save protocol component script error", e);
|
throw new BizException("save protocol component script error", e);
|
||||||
}
|
}
|
||||||
|
|
0
rule-engine/src/main/java/cc/iotkit/ruleengine/action/AlertAction.java
Normal file → Executable file
0
rule-engine/src/main/java/cc/iotkit/ruleengine/action/AlertAction.java
Normal file → Executable file
0
rule-engine/src/main/java/cc/iotkit/ruleengine/action/AlertService.java
Normal file → Executable file
0
rule-engine/src/main/java/cc/iotkit/ruleengine/action/AlertService.java
Normal file → Executable file
0
rule-engine/src/main/java/cc/iotkit/ruleengine/action/ScriptService.java
Normal file → Executable file
0
rule-engine/src/main/java/cc/iotkit/ruleengine/action/ScriptService.java
Normal file → Executable file
0
rule-engine/src/main/java/cc/iotkit/ruleengine/alert/DingdRobotAlerter.java
Normal file → Executable file
0
rule-engine/src/main/java/cc/iotkit/ruleengine/alert/DingdRobotAlerter.java
Normal file → Executable file
0
rule-engine/src/main/java/cc/iotkit/ruleengine/alert/EmailAlerter.java
Normal file → Executable file
0
rule-engine/src/main/java/cc/iotkit/ruleengine/alert/EmailAlerter.java
Normal file → Executable file
Loading…
Reference in New Issue