diff --git a/src/main/java/ch/wisv/events/core/webhook/WebhookPublisher.java b/src/main/java/ch/wisv/events/core/webhook/WebhookPublisher.java index c3007246..de7ebef4 100644 --- a/src/main/java/ch/wisv/events/core/webhook/WebhookPublisher.java +++ b/src/main/java/ch/wisv/events/core/webhook/WebhookPublisher.java @@ -74,7 +74,7 @@ public void createWebhookTask(WebhookTrigger webhookTrigger, Object content) { * @return boolean */ private boolean isWebhookAuthenticated(Webhook webhook, Object content) { - if (webhook.getLdapGroup() == ch.wisv.events.utils.LdapGroup.CHBEHEER) { + if (webhook.getLdapGroup() == ch.wisv.events.utils.LdapGroup.BEHEER) { return true; } else { if (content instanceof Event) { diff --git a/src/main/java/ch/wisv/events/sales/service/SalesServiceImpl.java b/src/main/java/ch/wisv/events/sales/service/SalesServiceImpl.java index 196acd66..ef687aa0 100644 --- a/src/main/java/ch/wisv/events/sales/service/SalesServiceImpl.java +++ b/src/main/java/ch/wisv/events/sales/service/SalesServiceImpl.java @@ -50,7 +50,7 @@ public SalesServiceImpl(EventService eventService, OrderService orderService) { */ @Override public List getAllGrantedEventByCustomer(Customer customer) { - if (customer.getLdapGroups().contains(LdapGroup.BESTUUR)) { + if (customer.getLdapGroups().contains(LdapGroup.BESTUUR) || customer.getLdapGroups().contains(LdapGroup.BEHEER)) { return eventService.getUpcoming(); } else { return eventService.getUpcoming().stream() diff --git a/src/main/java/ch/wisv/events/utils/LdapGroup.java b/src/main/java/ch/wisv/events/utils/LdapGroup.java index 59ae9896..617c3bf6 100644 --- a/src/main/java/ch/wisv/events/utils/LdapGroup.java +++ b/src/main/java/ch/wisv/events/utils/LdapGroup.java @@ -5,7 +5,7 @@ public enum LdapGroup { AKCIE("AkCie"), ANNUCIE("AnnuCie"), BT("Business Tour"), - CHBEHEER("CH Beheer"), + BEHEER("Beheer"), CHIPCIE("CHipCie"), CHOCO("CHoCo"), COMMA("ComMA"), diff --git a/src/main/resources/dev/data/webhooks.json b/src/main/resources/dev/data/webhooks.json index f2c5a0ac..59aaf3f5 100644 --- a/src/main/resources/dev/data/webhooks.json +++ b/src/main/resources/dev/data/webhooks.json @@ -1,6 +1,6 @@ [ { - "ldapGroup": "CHBEHEER", + "ldapGroup": "BEHEER", "payloadUrl": "http://localhost:1234/wp-json/events-sync/v1/single/", "triggers": [ "EVENT_CREATE_UPDATE", @@ -10,7 +10,7 @@ ] }, { - "ldapGroup": "CHBEHEER", + "ldapGroup": "BEHEER", "payloadUrl": "http://localhost:9000/payments/api/chevents/sync/product/", "triggers": [ "PRODUCT_CREATE_UPDATE", diff --git a/src/test/java/ch/wisv/events/ControllerTest.java b/src/test/java/ch/wisv/events/ControllerTest.java index 56459d39..c775f182 100644 --- a/src/test/java/ch/wisv/events/ControllerTest.java +++ b/src/test/java/ch/wisv/events/ControllerTest.java @@ -201,7 +201,7 @@ protected OrderProduct createOrderProduct(Product product) { protected Webhook createWebhook() { Webhook webhook = new Webhook(); webhook.setActive(true); - webhook.setLdapGroup(LdapGroup.CHBEHEER); + webhook.setLdapGroup(LdapGroup.BEHEER); webhook.setPayloadUrl("https://test.frl/"); webhook.setSecret("secret"); webhook.setWebhookTriggers(ImmutableList.of(WebhookTrigger.EVENT_CREATE_UPDATE)); diff --git a/src/test/java/ch/wisv/events/EventsApplicationTest.java b/src/test/java/ch/wisv/events/EventsApplicationTest.java index 5636bae4..1ce2e873 100644 --- a/src/test/java/ch/wisv/events/EventsApplicationTest.java +++ b/src/test/java/ch/wisv/events/EventsApplicationTest.java @@ -52,7 +52,7 @@ public MailService mailService() { public AuthenticationService authenticationService() { AuthenticationService service = Mockito.mock(AuthenticationService.class); Customer customer = new Customer(); - customer.setLdapGroups(ImmutableList.of(LdapGroup.CHBEHEER)); + customer.setLdapGroups(ImmutableList.of(LdapGroup.BEHEER)); Mockito.when(service.getCurrentCustomer()).thenReturn(customer); return service; diff --git a/src/test/java/ch/wisv/events/admin/controller/DashboardWebhookControllerTest.java b/src/test/java/ch/wisv/events/admin/controller/DashboardWebhookControllerTest.java index bccf1047..49fefc66 100644 --- a/src/test/java/ch/wisv/events/admin/controller/DashboardWebhookControllerTest.java +++ b/src/test/java/ch/wisv/events/admin/controller/DashboardWebhookControllerTest.java @@ -102,7 +102,7 @@ public void testCreatePost() throws Exception { mockMvc.perform(post("/administrator/webhooks/create") .param("payloadUrl", "https://test.frl") - .param("ldapGroup", "CHBEHEER") + .param("ldapGroup", "BEHEER") .sessionAttr("webhook", webhook)) .andExpect(status().is3xxRedirection()) .andExpect(redirectedUrl("/administrator/webhooks/")) @@ -138,7 +138,7 @@ public void testEditPost() throws Exception { mockMvc.perform(post("/administrator/webhooks/edit/" + webhook.getKey()) .param("payloadUrl", "https://test.frl") - .param("ldapGroup", "CHBEHEER") + .param("ldapGroup", "BEHEER") .sessionAttr("webhook", webhook)) .andExpect(status().is3xxRedirection()) .andExpect(redirectedUrl("/administrator/webhooks/view/" + webhook.getKey())) @@ -152,7 +152,7 @@ public void testEditPostInvalidPayloadUrl() throws Exception { mockMvc.perform(post("/administrator/webhooks/edit/" + webhook.getKey()) .param("payloadUrl", "") - .param("ldapGroup", "CHBEHEER") + .param("ldapGroup", "BEHEER") .sessionAttr("webhook", webhook)) .andExpect(status().is3xxRedirection()) .andExpect(redirectedUrl("/administrator/webhooks/edit/" + webhook.getKey())) diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties index 64b7d923..b0b3b6a3 100644 --- a/src/test/resources/application-test.properties +++ b/src/test/resources/application-test.properties @@ -1,7 +1,7 @@ # Connect Configuration wisvch.connect.issuerUri=https://connect.ch.tudelft.nl/ wisvch.connect.clientUri=http://localhost:9000/ -wisvch.connect.admin.groups=bestuur,chbeheer,w3cie,vc +wisvch.connect.admin.groups=bestuur,beheer,w3cie,vc # Serve connect server.port=9000