working on project settings update:

adding/updating members not implemented
This commit is contained in:
2025-07-21 00:16:14 +02:00
parent c8b6c3feb7
commit 6016f81c27
17 changed files with 169 additions and 34 deletions

View File

@@ -11,6 +11,7 @@ import static de.srsoftware.umbrella.core.ResponseCode.HTTP_NOT_IMPLEMENTED;
import static de.srsoftware.umbrella.core.Util.mapValues;
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.forbidden;
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.missingFieldException;
import static de.srsoftware.umbrella.project.Constants.PERMISSIONS;
import static de.srsoftware.umbrella.task.Constants.*;
import com.sun.net.httpserver.HttpExchange;
@@ -56,6 +57,7 @@ public class TaskModule extends BaseHandler implements TaskService {
if (user.isEmpty()) return unauthorized(ex);
var head = path.pop();
return switch (head) {
case PERMISSIONS -> getPermissionList(ex);
case STATES -> getStateList(ex);
default -> super.doGet(path,ex);
};
@@ -104,6 +106,12 @@ public class TaskModule extends BaseHandler implements TaskService {
return sendContent(ex,result);
}
private boolean getPermissionList(HttpExchange ex) throws IOException {
var map = new HashMap<Integer,String>();
for (var permission : Permission.values()) map.put(permission.code(),permission.name());
return sendContent(ex,map);
}
private boolean getStateList(HttpExchange ex) throws IOException {
var map = new HashMap<Integer,String>();
for (var status : Status.values()) map.put(status.code(),status.name());