You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by ju...@apache.org on 2019/10/09 07:40:25 UTC

[fineract-cn-group] 23/50: adding permittableGroupIds and modifiying the bootstrap.yml file

This is an automated email from the ASF dual-hosted git repository.

juhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-group.git

commit 3ce19f90332adf1a18f1bd16cd096cea8f00f59b
Author: kengneruphine <ru...@gmail.com>
AuthorDate: Mon Jun 18 16:24:33 2018 +0100

    adding permittableGroupIds and modifiying the bootstrap.yml file
---
 .../cn/group/api/v1/PermittableGroupIds.java       | 27 ++++++++++++++++++++++
 .../group/rest/GroupDefinitionRestController.java  |  7 +++---
 .../cn/group/rest/GroupRestController.java         | 14 ++++++++---
 service/src/main/resources/bootstrap.yml           |  2 +-
 4 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/api/src/main/java/org/apache/fineract/cn/group/api/v1/PermittableGroupIds.java b/api/src/main/java/org/apache/fineract/cn/group/api/v1/PermittableGroupIds.java
new file mode 100644
index 0000000..48738c8
--- /dev/null
+++ b/api/src/main/java/org/apache/fineract/cn/group/api/v1/PermittableGroupIds.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.fineract.cn.group.api.v1;
+
+public interface PermittableGroupIds {
+
+    String GROUP = "group__v1__group";
+    String DEFINITION = "group__v1__definition";
+}
\ No newline at end of file
diff --git a/service/src/main/java/org/apache/fineract/cn/group/rest/GroupDefinitionRestController.java b/service/src/main/java/org/apache/fineract/cn/group/rest/GroupDefinitionRestController.java
index a526450..1250560 100644
--- a/service/src/main/java/org/apache/fineract/cn/group/rest/GroupDefinitionRestController.java
+++ b/service/src/main/java/org/apache/fineract/cn/group/rest/GroupDefinitionRestController.java
@@ -18,6 +18,7 @@
  */
 package org.apache.fineract.cn.group.rest;
 
+import org.apache.fineract.cn.group.api.v1.PermittableGroupIds;
 import org.apache.fineract.cn.group.api.v1.domain.GroupDefinition;
 import org.apache.fineract.cn.group.ServiceConstants;
 import org.apache.fineract.cn.group.internal.command.CreateGroupDefinitionCommand;
@@ -58,7 +59,7 @@ public class GroupDefinitionRestController {
     this.groupDefinitionService = groupDefinitionService;
   }
 
-  @Permittable(AcceptedTokenType.TENANT)
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.DEFINITION)
   @RequestMapping(
       method = RequestMethod.POST,
       consumes = MediaType.APPLICATION_JSON_VALUE,
@@ -76,7 +77,7 @@ public class GroupDefinitionRestController {
     return ResponseEntity.accepted().build();
   }
 
-  @Permittable(AcceptedTokenType.TENANT)
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.DEFINITION)
   @RequestMapping(
       method = RequestMethod.GET,
       consumes = MediaType.ALL_VALUE,
@@ -88,7 +89,7 @@ public class GroupDefinitionRestController {
     return ResponseEntity.ok(this.groupDefinitionService.fetchAllGroupDefinitions());
   }
 
-  @Permittable(AcceptedTokenType.TENANT)
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.DEFINITION)
   @RequestMapping(
       value = "/{identifier}",
       method = RequestMethod.GET,
diff --git a/service/src/main/java/org/apache/fineract/cn/group/rest/GroupRestController.java b/service/src/main/java/org/apache/fineract/cn/group/rest/GroupRestController.java
index c9edae9..ee0e55e 100644
--- a/service/src/main/java/org/apache/fineract/cn/group/rest/GroupRestController.java
+++ b/service/src/main/java/org/apache/fineract/cn/group/rest/GroupRestController.java
@@ -25,6 +25,7 @@ import org.apache.fineract.cn.group.api.v1.domain.GroupPage;
 import org.apache.fineract.cn.group.api.v1.domain.Meeting;
 import org.apache.fineract.cn.group.api.v1.domain.SignOffMeeting;
 import org.apache.fineract.cn.group.ServiceConstants;
+import org.apache.fineract.cn.group.api.v1.PermittableGroupIds;
 import org.apache.fineract.cn.group.internal.command.ActivateGroupCommand;
 import org.apache.fineract.cn.group.internal.command.CloseGroupCommand;
 import org.apache.fineract.cn.group.internal.command.CreateGroupCommand;
@@ -80,7 +81,7 @@ public class GroupRestController {
     this.groupDefinitionService = groupDefinitionService;
   }
 
-  @Permittable(AcceptedTokenType.TENANT)
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.GROUP)
   @RequestMapping(
       method = RequestMethod.POST,
       consumes = MediaType.APPLICATION_JSON_VALUE,
@@ -102,7 +103,7 @@ public class GroupRestController {
     return ResponseEntity.accepted().build();
   }
 
-  @Permittable(AcceptedTokenType.TENANT)
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.GROUP)
   @RequestMapping(
       method = RequestMethod.GET,
       consumes = MediaType.ALL_VALUE,
@@ -121,7 +122,7 @@ public class GroupRestController {
     );
   }
 
-  @Permittable(AcceptedTokenType.TENANT)
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.GROUP)
   @RequestMapping(
       value = "/{identifier}",
       method = RequestMethod.GET,
@@ -136,6 +137,7 @@ public class GroupRestController {
         .orElseThrow(() -> ServiceException.notFound("Group {0} not found.", identifier));
   }
 
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.GROUP)
   @RequestMapping(
       value = "/{identifier}/commands",
       method = RequestMethod.POST,
@@ -163,6 +165,7 @@ public class GroupRestController {
     return ResponseEntity.accepted().build();
   }
 
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.GROUP)
   @RequestMapping(
       value = "/{identifier}/commands",
       method = RequestMethod.GET,
@@ -175,6 +178,7 @@ public class GroupRestController {
     return ResponseEntity.ok(this.groupService.findCommandsByIdentifier(identifier));
   }
 
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.GROUP)
   @RequestMapping(
       value = "/{identifier}/leaders",
       method = RequestMethod.PUT,
@@ -193,6 +197,7 @@ public class GroupRestController {
     return ResponseEntity.accepted().build();
   }
 
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.GROUP)
   @RequestMapping(
       value = "/{identifier}/members",
       method = RequestMethod.PUT,
@@ -211,6 +216,7 @@ public class GroupRestController {
     return ResponseEntity.accepted().build();
   }
 
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.GROUP)
   @RequestMapping(
       value = "/{identifier}/employee",
       method = RequestMethod.PUT,
@@ -230,6 +236,7 @@ public class GroupRestController {
     return ResponseEntity.accepted().build();
   }
 
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.GROUP)
   @RequestMapping(
       value = "/{identifier}/meetings",
       method = RequestMethod.GET,
@@ -245,6 +252,7 @@ public class GroupRestController {
     return ResponseEntity.ok(this.groupService.findMeetings(groupIdentifier, upcoming));
   }
 
+  @Permittable(value= AcceptedTokenType.TENANT, groupId = PermittableGroupIds.GROUP)
   @RequestMapping(
       value = "/{identifier}/meetings",
       method = RequestMethod.PUT,
diff --git a/service/src/main/resources/bootstrap.yml b/service/src/main/resources/bootstrap.yml
index 93851b3..79e4528 100644
--- a/service/src/main/resources/bootstrap.yml
+++ b/service/src/main/resources/bootstrap.yml
@@ -19,4 +19,4 @@
 
 spring:
     application:
-        name: group-api
+        name: group-v1