From 1a485a02349a48d2254573adcff1c56731c70a00 Mon Sep 17 00:00:00 2001 From: Olivier Fuxet Date: Fri, 30 Aug 2024 14:54:05 +0200 Subject: [PATCH] Add PermissionPort --- .../kernel/port/output/PermissionPort.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/main/java/onlydust/com/marketplace/kernel/port/output/PermissionPort.java diff --git a/src/main/java/onlydust/com/marketplace/kernel/port/output/PermissionPort.java b/src/main/java/onlydust/com/marketplace/kernel/port/output/PermissionPort.java new file mode 100644 index 0000000..7734678 --- /dev/null +++ b/src/main/java/onlydust/com/marketplace/kernel/port/output/PermissionPort.java @@ -0,0 +1,24 @@ +package onlydust.com.marketplace.kernel.port.output; + +import onlydust.com.marketplace.kernel.model.ProgramId; +import onlydust.com.marketplace.kernel.model.ProjectId; +import onlydust.com.marketplace.kernel.model.SponsorId; +import onlydust.com.marketplace.kernel.model.UserId; + +public interface PermissionPort { + boolean isUserProjectLead(ProjectId projectId, UserId projectLeadId); + + boolean isUserContributor(String contributionId, Long githubUserId); + + boolean isRepoLinkedToProject(ProjectId projectId, Long githubRepoId); + + boolean hasUserAccessToProject(ProjectId projectId, UserId userId); + + boolean hasUserAccessToProject(String projectSlug, UserId userId); + + boolean isUserSponsorLead(UserId userId, SponsorId sponsorId); + + boolean isUserSponsorLeadOfProgram(UserId userId, ProgramId programId); + + boolean isUserProgramLead(UserId userId, ProgramId programId); +} \ No newline at end of file