From d262926c41f924a2b063bc7ed5105c86835c687f Mon Sep 17 00:00:00 2001 From: Martin Lowe Date: Tue, 30 Nov 2021 15:34:49 -0500 Subject: [PATCH] Update to org endpoints to add missing perms --- .../react/resources/OrganizationResource.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/eclipsefoundation/react/resources/OrganizationResource.java b/src/main/java/org/eclipsefoundation/react/resources/OrganizationResource.java index d42562fd..0cff0f5c 100644 --- a/src/main/java/org/eclipsefoundation/react/resources/OrganizationResource.java +++ b/src/main/java/org/eclipsefoundation/react/resources/OrganizationResource.java @@ -14,6 +14,7 @@ package org.eclipsefoundation.react.resources; import static org.eclipsefoundation.react.namespace.OrganizationalUserType.CR; import static org.eclipsefoundation.react.namespace.OrganizationalUserType.CRA; import static org.eclipsefoundation.react.namespace.OrganizationalUserType.DE; +import static org.eclipsefoundation.react.namespace.OrganizationalUserType.MR; import static org.eclipsefoundation.react.namespace.OrganizationalUserType.EMPLY; import java.time.LocalDate; @@ -139,7 +140,7 @@ public class OrganizationResource extends AbstractRESTResource { @POST @Authenticated - @RolesAllowed({ CR, DE, CRA, CRA }) + @RolesAllowed({ CR, DE, CRA }) @Path("{orgID:\\d+}") public Response update(@PathParam("orgID") String organizationID, OrganizationInfoUpdateRequest updateRequest) { // get ref and update the object @@ -171,7 +172,7 @@ public class OrganizationResource extends AbstractRESTResource { @GET @Authenticated - @RolesAllowed({ EMPLY }) + @RolesAllowed({ EMPLY, CR, DE, CRA, MR }) @Path("{orgID:\\d+}/activity") public Response getPeriodActivity(@PathParam("orgID") String organizationID, @QueryParam("period") String period, @QueryParam("from_period") String fromPeriod) { @@ -185,7 +186,7 @@ public class OrganizationResource extends AbstractRESTResource { @GET @Authenticated - @RolesAllowed({ EMPLY }) + @RolesAllowed({ EMPLY, CR, DE, CRA, MR }) @Path("{orgID:\\d+}/activity/overview") public Response getPeriodActivityOverview(@PathParam("orgID") String organizationID, @QueryParam("period") String period, @QueryParam("from_period") String fromPeriod) { @@ -199,7 +200,7 @@ public class OrganizationResource extends AbstractRESTResource { @GET @Authenticated - @RolesAllowed({ EMPLY }) + @RolesAllowed({ EMPLY, CR, DE, CRA, MR }) @Path("{orgID:\\d+}/activity/yearly") public Response getPeriodActivityYearly(@PathParam("orgID") String organizationID) { LocalDate d = LocalDate.now(); @@ -321,7 +322,7 @@ public class OrganizationResource extends AbstractRESTResource { @GET @Authenticated - @RolesAllowed({ EMPLY }) + @RolesAllowed({ EMPLY, CR, DE, CRA, MR }) @Path("{orgID:\\d+}/committers") public Response getCommitters(@PathParam("orgID") String organizationID) { Optional> committers = orgService.getCommittersForOrganization(organizationID); @@ -334,7 +335,7 @@ public class OrganizationResource extends AbstractRESTResource { @GET @Authenticated - @RolesAllowed({ EMPLY }) + @RolesAllowed({ EMPLY, CR, DE, CRA, MR }) @Path("{orgID:\\d+}/committers/activity") public Response getCommitterActivityOverview(@PathParam("orgID") String organizationID, @QueryParam("period") String period, @QueryParam("from_period") String fromPeriod) { @@ -352,7 +353,7 @@ public class OrganizationResource extends AbstractRESTResource { @GET @Authenticated - @RolesAllowed({ EMPLY }) + @RolesAllowed({ EMPLY, CR, DE, CRA, MR }) @Path("{orgID:\\d+}/committers/activity/yearly") public Response getCommitterActivityYearly(@PathParam("orgID") String organizationID) { LocalDate d = LocalDate.now(); @@ -382,7 +383,7 @@ public class OrganizationResource extends AbstractRESTResource { @GET @Authenticated - @RolesAllowed({ EMPLY }) + @RolesAllowed({ EMPLY, CR, DE, CRA, MR }) @Path("{orgID:\\d+}/contributors") public Response getContributors(@PathParam("orgID") String organizationID) { Optional> committers = orgService.getContributorsForOrganization(organizationID); -- GitLab