Skip to content

Commit 9a68584

Browse files
committed
Add operation scope modal.
1 parent e6ec038 commit 9a68584

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed

core/org.wso2.carbon.utils/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@
278278
org.wso2.carbon.keystore.persistence.model,
279279
org.wso2.carbon.utils.*,
280280
org.wso2.carbon.context,
281-
!org.wso2.carbon.context.internal
281+
!org.wso2.carbon.context.internal,
282+
org.wso2.carbon.context.model
282283
</Export-Package>
283284
<Bundle-Activator>org.wso2.carbon.context.internal.CarbonContextActivator</Bundle-Activator>
284285
<Private-Package>

core/org.wso2.carbon.utils/src/main/java/org/wso2/carbon/context/OperationScopeValidationContext.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
package org.wso2.carbon.context;
2020

21+
import org.wso2.carbon.context.model.OperationScope;
22+
2123
import java.util.List;
2224
import java.util.Map;
2325
import java.util.concurrent.ConcurrentHashMap;
@@ -33,7 +35,7 @@ public class OperationScopeValidationContext {
3335
private String apiIdentifier;
3436
private boolean validationRequired;
3537
private List<String> validatedScopes;
36-
private Map<String, String> operationScopeMap = new ConcurrentHashMap<>();
38+
private Map<String, OperationScope> operationScopeMap = new ConcurrentHashMap<>();
3739

3840
public String getApiIdentifier() {
3941

@@ -65,12 +67,12 @@ public void setValidatedScopes(List<String> validatedScopes) {
6567
this.validatedScopes = validatedScopes;
6668
}
6769

68-
public Map<String, String> getOperationScopeMap() {
70+
public Map<String, OperationScope> getOperationScopeMap() {
6971

7072
return operationScopeMap;
7173
}
7274

73-
public void setOperationScopeMap(Map<String, String> operationScopeMap) {
75+
public void setOperationScopeMap(Map<String, OperationScope> operationScopeMap) {
7476

7577
this.operationScopeMap = operationScopeMap;
7678
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com).
3+
*
4+
* WSO2 LLC. licenses this file to you under the Apache License,
5+
* Version 2.0 (the "License"); you may not use this file except
6+
* in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing,
12+
* software distributed under the License is distributed on an
13+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
* KIND, either express or implied. See the License for the
15+
* specific language governing permissions and limitations
16+
* under the License.
17+
*/
18+
package org.wso2.carbon.context.model;
19+
20+
/**
21+
* Model class to hold operation scope details.
22+
*/
23+
public class OperationScope {
24+
25+
private boolean isMandatory;
26+
private String scope;
27+
28+
public void setIsMandatory(boolean isMandatory) {
29+
this.isMandatory = isMandatory;
30+
}
31+
32+
public boolean getIsMandatory() {
33+
return isMandatory;
34+
}
35+
36+
public void setScope(String scope) {
37+
this.scope = scope;
38+
}
39+
40+
public String getScope() {
41+
return scope;
42+
}
43+
44+
}

0 commit comments

Comments
 (0)