@@ -78,11 +78,11 @@ public OpenItemDTO getItemByEncodedKey(@PathVariable String appId, @PathVariable
78
78
new String (Base64 .getDecoder ().decode (key .getBytes (StandardCharsets .UTF_8 ))));
79
79
}
80
80
81
- @ PreAuthorize (value = "@consumerPermissionValidator.hasModifyNamespacePermission(#request , #appId , #namespaceName , #env )" )
81
+ @ PreAuthorize (value = "@consumerPermissionValidator.hasModifyNamespacePermission(#appId , #env , #clusterName , #namespaceName )" )
82
82
@ PostMapping (value = "/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items" )
83
83
public OpenItemDTO createItem (@ PathVariable String appId , @ PathVariable String env ,
84
84
@ PathVariable String clusterName , @ PathVariable String namespaceName ,
85
- @ RequestBody OpenItemDTO item , HttpServletRequest request ) {
85
+ @ RequestBody OpenItemDTO item ) {
86
86
87
87
RequestPrecondition .checkArguments (
88
88
!StringUtils .isContainEmpty (item .getKey (), item .getDataChangeCreatedBy ()),
@@ -99,12 +99,12 @@ public OpenItemDTO createItem(@PathVariable String appId, @PathVariable String e
99
99
return this .itemOpenApiService .createItem (appId , env , clusterName , namespaceName , item );
100
100
}
101
101
102
- @ PreAuthorize (value = "@consumerPermissionValidator.hasModifyNamespacePermission(#request , #appId , #namespaceName , #env )" )
102
+ @ PreAuthorize (value = "@consumerPermissionValidator.hasModifyNamespacePermission(#appId , #env , #clusterName , #namespaceName )" )
103
103
@ PutMapping (value = "/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/{key:.+}" )
104
104
public void updateItem (@ PathVariable String appId , @ PathVariable String env ,
105
105
@ PathVariable String clusterName , @ PathVariable String namespaceName ,
106
106
@ PathVariable String key , @ RequestBody OpenItemDTO item ,
107
- @ RequestParam (defaultValue = "false" ) boolean createIfNotExists , HttpServletRequest request ) {
107
+ @ RequestParam (defaultValue = "false" ) boolean createIfNotExists ) {
108
108
109
109
RequestPrecondition .checkArguments (item != null , "item payload can not be empty" );
110
110
@@ -132,23 +132,22 @@ public void updateItem(@PathVariable String appId, @PathVariable String env,
132
132
}
133
133
}
134
134
135
- @ PreAuthorize (value = "@consumerPermissionValidator.hasModifyNamespacePermission(#request , #appId , #namespaceName , #env )" )
135
+ @ PreAuthorize (value = "@consumerPermissionValidator.hasModifyNamespacePermission(#appId , #env , #clusterName , #namespaceName )" )
136
136
@ PutMapping (value = "/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/encodedItems/{key:.+}" )
137
137
public void updateItemByEncodedKey (@ PathVariable String appId , @ PathVariable String env ,
138
138
@ PathVariable String clusterName , @ PathVariable String namespaceName ,
139
139
@ PathVariable String key , @ RequestBody OpenItemDTO item ,
140
- @ RequestParam (defaultValue = "false" ) boolean createIfNotExists , HttpServletRequest request ) {
140
+ @ RequestParam (defaultValue = "false" ) boolean createIfNotExists ) {
141
141
this .updateItem (appId , env , clusterName , namespaceName ,
142
142
new String (Base64 .getDecoder ().decode (key .getBytes (StandardCharsets .UTF_8 ))), item ,
143
- createIfNotExists , request );
143
+ createIfNotExists );
144
144
}
145
145
146
- @ PreAuthorize (value = "@consumerPermissionValidator.hasModifyNamespacePermission(#request , #appId , #namespaceName , #env )" )
146
+ @ PreAuthorize (value = "@consumerPermissionValidator.hasModifyNamespacePermission(#appId , #env , #clusterName , #namespaceName )" )
147
147
@ DeleteMapping (value = "/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/{key:.+}" )
148
148
public void deleteItem (@ PathVariable String appId , @ PathVariable String env ,
149
149
@ PathVariable String clusterName , @ PathVariable String namespaceName ,
150
- @ PathVariable String key , @ RequestParam String operator ,
151
- HttpServletRequest request ) {
150
+ @ PathVariable String key , @ RequestParam String operator ) {
152
151
153
152
if (userService .findByUserId (operator ) == null ) {
154
153
throw BadRequestException .userNotExists (operator );
@@ -162,15 +161,13 @@ public void deleteItem(@PathVariable String appId, @PathVariable String env,
162
161
this .itemOpenApiService .removeItem (appId , env , clusterName , namespaceName , key , operator );
163
162
}
164
163
165
- @ PreAuthorize (value = "@consumerPermissionValidator.hasModifyNamespacePermission(#request , #appId , #namespaceName , #env )" )
164
+ @ PreAuthorize (value = "@consumerPermissionValidator.hasModifyNamespacePermission(#appId , #env , #clusterName , #namespaceName )" )
166
165
@ DeleteMapping (value = "/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/encodedItems/{key:.+}" )
167
166
public void deleteItemByEncodedKey (@ PathVariable String appId , @ PathVariable String env ,
168
167
@ PathVariable String clusterName , @ PathVariable String namespaceName ,
169
- @ PathVariable String key , @ RequestParam String operator ,
170
- HttpServletRequest request ) {
168
+ @ PathVariable String key , @ RequestParam String operator ) {
171
169
this .deleteItem (appId , env , clusterName , namespaceName ,
172
- new String (Base64 .getDecoder ().decode (key .getBytes (StandardCharsets .UTF_8 ))), operator ,
173
- request );
170
+ new String (Base64 .getDecoder ().decode (key .getBytes (StandardCharsets .UTF_8 ))), operator );
174
171
}
175
172
176
173
@ GetMapping (value = "/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items" )
0 commit comments