17 changed files with 157 additions and 78 deletions
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
/* © SRSoftware 2025 */ |
||||
package de.srsoftware.umbrella.core.model; |
||||
|
||||
|
||||
public record Member(UmbrellaUser user, Permission permission){ } |
||||
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
/* © SRSoftware 2025 */ |
||||
package de.srsoftware.umbrella.core.model; |
||||
|
||||
import static java.text.MessageFormat.format; |
||||
|
||||
import java.security.InvalidParameterException; |
||||
|
||||
public enum Permission { |
||||
OWNER(1), |
||||
EDIT(2), |
||||
ASSIGNEE(3), |
||||
READ_ONLY(4); |
||||
|
||||
private final int code; |
||||
|
||||
Permission(int code){ |
||||
this.code = code; |
||||
} |
||||
|
||||
public int code(){ |
||||
return code; |
||||
} |
||||
|
||||
public static Permission of(int code){ |
||||
for (var p : Permission.values()){ |
||||
if (p.code == code) return p; |
||||
} |
||||
throw new InvalidParameterException(format("{0} is not a valid permission code")); |
||||
} |
||||
} |
||||
@ -1,12 +1,13 @@
@@ -1,12 +1,13 @@
|
||||
/* © SRSoftware 2025 */ |
||||
package de.srsoftware.umbrella.project; |
||||
|
||||
import de.srsoftware.umbrella.core.api.UserService; |
||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException; |
||||
import de.srsoftware.umbrella.core.model.Project; |
||||
import java.util.Collection; |
||||
import java.util.Map; |
||||
|
||||
public interface ProjectDb { |
||||
Collection<Project> list(long companyId, boolean includeClosed) throws UmbrellaException; |
||||
Map<Long, Project> list(long companyId, boolean includeClosed, UserService userService) throws UmbrellaException; |
||||
|
||||
Project save(Project prj); |
||||
Project save(Project prj) throws UmbrellaException; |
||||
} |
||||
|
||||
Loading…
Reference in new issue