public class PolicyRestrictor extends Object implements Restrictor
| Constructor and Description |
|---|
PolicyRestrictor(InputStream pInput)
Construct a policy restrictor from an input stream
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAttributeReadAllowed(ObjectName pName,
String pAttribute)
Check whether reading of an attribute is allowed
|
boolean |
isAttributeWriteAllowed(ObjectName pName,
String pAttribute)
Check whether writing of an attribute is allowed
|
boolean |
isHttpMethodAllowed(HttpMethod method)
Check whether the HTTP method with which the request
was sent is allowed.
|
boolean |
isOperationAllowed(ObjectName pName,
String pOperation)
Check whether execution of an operation is allowed
|
boolean |
isOriginAllowed(String pOrigin,
boolean pOnlyWhenStrictCheckingIsEnabled)
Check whether cross browser access via CORS is allowed.
|
boolean |
isRemoteAccessAllowed(String... pHostOrAddress)
Check whether access from the connected client is allowed.
|
boolean |
isTypeAllowed(RequestType pType)
Check whether the provided command type is allowed in principal
|
public PolicyRestrictor(InputStream pInput)
pInput - stream from where to fetch the policy datapublic boolean isHttpMethodAllowed(HttpMethod method)
isHttpMethodAllowed in interface Restrictormethod - method to checkpublic boolean isTypeAllowed(RequestType pType)
isTypeAllowed in interface RestrictorpType - type to checkpublic boolean isRemoteAccessAllowed(String... pHostOrAddress)
isRemoteAccessAllowed in interface RestrictorpHostOrAddress - one or more host or address names.public boolean isOriginAllowed(String pOrigin, boolean pOnlyWhenStrictCheckingIsEnabled)
isOriginAllowed in interface RestrictorpOrigin - the "Origin:" header provided within the requestpOnlyWhenStrictCheckingIsEnabled - whether by-pass check when strict checking is disabledpublic boolean isAttributeReadAllowed(ObjectName pName, String pAttribute)
isAttributeReadAllowed in interface RestrictorpName - MBean namepAttribute - attribute to checkpublic boolean isAttributeWriteAllowed(ObjectName pName, String pAttribute)
isAttributeWriteAllowed in interface RestrictorpName - MBean namepAttribute - attribute to checkpublic boolean isOperationAllowed(ObjectName pName, String pOperation)
isOperationAllowed in interface RestrictorpName - MBean namepOperation - attribute to checkCopyright © 2019. All rights reserved.