implemented deletion of tasks
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -8,6 +8,7 @@ public class Constants {
|
||||
|
||||
|
||||
private Constants(){}
|
||||
|
||||
public static final String ADDRESS = "address";
|
||||
public static final String ATTACHMENTS = "attachments";
|
||||
public static final String AUTHORIZATION = "Authorization";
|
||||
@@ -23,6 +24,7 @@ public class Constants {
|
||||
public static final String DATE = "date";
|
||||
public static final String DEFAULT_LANGUAGE = "en";
|
||||
public static final String DEFAULT_THEME = "winter";
|
||||
public static final String DELETED = "deleted";
|
||||
public static final String DESCRIPTION = "description";
|
||||
public static final String DOMAIN = "domain";
|
||||
public static final String DROP_MEMBER = "drop_member";
|
||||
|
||||
@@ -31,7 +31,7 @@ public class UmbrellaException extends RuntimeException{
|
||||
|
||||
public static UmbrellaException databaseException(String message, Object... fills) {
|
||||
System.getLogger("Configuration").log(WARNING,message,fills);
|
||||
return new UmbrellaException(HTTP_SERVER_ERROR,message,fills);
|
||||
return new UmbrellaException(message,fills);
|
||||
}
|
||||
|
||||
public static UmbrellaException forbidden(String message, Object... fills) {
|
||||
@@ -45,7 +45,7 @@ public class UmbrellaException extends RuntimeException{
|
||||
|
||||
public static UmbrellaException missingConfigException(String field){
|
||||
System.getLogger("Configuration").log(ERROR,ERROR_MISSING_CONFIG, field);
|
||||
return new UmbrellaException(HTTP_SERVER_ERROR, ERROR_MISSING_CONFIG, field);
|
||||
return new UmbrellaException(ERROR_MISSING_CONFIG, field);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,4 +12,8 @@ public record Member(UmbrellaUser user, Permission permission) implements Mappab
|
||||
public Map<String, Object> toMap() {
|
||||
return Map.of(USER,user.toMap(),PERMISSION,permission.toMap());
|
||||
}
|
||||
|
||||
public boolean mayWrite() {
|
||||
return permission.mayWrite();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,15 +10,17 @@ import java.security.InvalidParameterException;
|
||||
import java.util.Map;
|
||||
|
||||
public enum Permission implements Mappable {
|
||||
OWNER(1),
|
||||
EDIT(2),
|
||||
ASSIGNEE(3),
|
||||
READ_ONLY(4);
|
||||
OWNER(1,true),
|
||||
EDIT(2,true),
|
||||
ASSIGNEE(3,true),
|
||||
READ_ONLY(4,false);
|
||||
|
||||
private final int code;
|
||||
private final boolean mayWrite;
|
||||
|
||||
Permission(int code){
|
||||
Permission(int code, boolean mayWrite){
|
||||
this.code = code;
|
||||
this.mayWrite = mayWrite;
|
||||
}
|
||||
|
||||
public int code(){
|
||||
@@ -36,4 +38,8 @@ public enum Permission implements Mappable {
|
||||
public Map<String, Object> toMap() {
|
||||
return Map.of(NAME,name(),CODE,code);
|
||||
}
|
||||
|
||||
public boolean mayWrite() {
|
||||
return mayWrite;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user