use of com.serotonin.m2m2.web.mvc.rest.v1.model.PermissionDefinitionModel in project ma-modules-public by infiniteautomation.
the class PermissionsRestController method listPermissions.
@ApiOperation(value = "List permissions and their system setting keys")
@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<List<PermissionDefinitionModel>> listPermissions() {
List<PermissionDefinitionModel> permissions = new ArrayList<>();
permissions.add(new PermissionDefinitionModel(SystemSettingsDao.PERMISSION_DATASOURCE, "systemSettings.permissions.datasourceManagement"));
for (PermissionDefinition def : ModuleRegistry.getDefinitions(PermissionDefinition.class)) {
permissions.add(new PermissionDefinitionModel(def));
}
return new ResponseEntity<>(permissions, HttpStatus.OK);
}
Aggregations