diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/OperationRule.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/OperationRule.java index 3afa2ae992e..0fefd7397e5 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/OperationRule.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/OperationRule.java @@ -33,7 +33,6 @@ import java.util.List; import java.util.Set; class OperationRule extends BaseRule implements IAuthRule { - private String myOperationName; private boolean myAppliesToServer; private HashSet> myAppliesToTypes; @@ -210,4 +209,39 @@ class OperationRule extends BaseRule implements IAuthRule { myOperationName = theOperationName; } + String getOperationName() { + return myOperationName; + } + + boolean isAppliesToServer() { + return myAppliesToServer; + } + + HashSet> getAppliesToTypes() { + return myAppliesToTypes; + } + + List getAppliesToIds() { + return myAppliesToIds; + } + + HashSet> getAppliesToInstancesOfType() { + return myAppliesToInstancesOfType; + } + + boolean isAppliesToAnyType() { + return myAppliesToAnyType; + } + + boolean isAppliesToAnyInstance() { + return myAppliesToAnyInstance; + } + + boolean isAppliesAtAnyLevel() { + return myAppliesAtAnyLevel; + } + + boolean isAllowAllResponses() { + return myAllowAllResponses; + } } diff --git a/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/OperationRuleUtil.java b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/OperationRuleUtil.java new file mode 100644 index 00000000000..7112df080eb --- /dev/null +++ b/hapi-fhir-test-utilities/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/OperationRuleUtil.java @@ -0,0 +1,16 @@ +package ca.uhn.fhir.rest.server.interceptor.auth; + +public final class OperationRuleUtil { + private OperationRuleUtil() {} + public static String getOperationName(IAuthRule theRule) { + return ((OperationRule)theRule).getOperationName(); + } + + public static boolean isAppliesToServer(IAuthRule theRule) { + return ((OperationRule)theRule).isAppliesToServer(); + } + + public static boolean isAllowAllResponses(IAuthRule theRule) { + return ((OperationRule)theRule).isAllowAllResponses(); + } +}