Browse Source

validasi role fix

athrainsky 10 months ago
parent
commit
23d585f394

+ 4 - 4
src/main/kotlin/com/swagger/rest/controllers/BugController.kt

@@ -264,13 +264,13 @@ class BugController(
         if (!Objects.equals(
                 Enum.Status.values()[bugData.status], Enum.Status.valueOf(bugInput.status.uppercase())
             )
-        ) {//col += "level,"
+        ) {//col += "status,"
             col += 8
         }
         if (!Objects.equals(
                 Enum.Dev_Status.values()[bugData.dev_status], Enum.Dev_Status.valueOf(bugInput.dev_status.uppercase())
             )
-        ) {//col += "level,"
+        ) {//col += "dev_status,"
             col += 9
         }
         var ret = false
@@ -278,9 +278,9 @@ class BugController(
             ret = true
         } else if (validAdmin > 0 || validOwner > 0) {
             ret = true
-        } else if (validQc > 0 && (col.contains(6) || col.contains(7) || col.contains(8))) {
+        } else if (validQc > 0 && !col.contains(1) && !col.contains(2) && !col.contains(3) && !col.contains(4)&& !col.contains(5)&& !col.contains(9)) {
             ret = true
-        } else if (validPro > 0 && col.contains(9)) {
+        } else if (validPro > 0 && col.contains(9) && col.count() == 1) {
             ret = true
         }
         return ret

+ 3 - 3
swagger3 project.yml

@@ -557,7 +557,7 @@ paths:
       parameters: 
         - $ref: '#/components/parameters/bugPath'
       requestBody:
-        description: Bug object
+        description: Bug object  | level (note, minor, major) status (onprogress, done, hold, cancel) dev_status (notstart, onprogress, done)
         required: true
         content:
           application/json:
@@ -1363,7 +1363,7 @@ components:
                   type: string
                   example: TelMesengger
     ProjectMember:
-      description: project member object (QC, Programmer, Admin)
+      description: project member object | role = QC, Programmer, Admin
       required: true
       content:
         application/json:
@@ -1408,7 +1408,7 @@ components:
                 type: string
                 example: abidzar
     Bug:
-      description: Bug object
+      description: Bug object  | level (note, minor, major) status (onprogress, done, hold, cancel) dev_status (notstart, onprogress, done)
       required: true
       content:
         application/json: