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 pIsStrictCheck)
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 Restrictor
method
- method to checkpublic boolean isTypeAllowed(RequestType pType)
isTypeAllowed
in interface Restrictor
pType
- type to checkpublic boolean isRemoteAccessAllowed(String... pHostOrAddress)
isRemoteAccessAllowed
in interface Restrictor
pHostOrAddress
- one or more host or address names.public boolean isOriginAllowed(String pOrigin, boolean pIsStrictCheck)
isOriginAllowed
in interface Restrictor
pOrigin
- the "Origin:" header provided within the requestpIsStrictCheck
- whether doing a strict checkpublic boolean isAttributeReadAllowed(ObjectName pName, String pAttribute)
isAttributeReadAllowed
in interface Restrictor
pName
- MBean namepAttribute
- attribute to checkpublic boolean isAttributeWriteAllowed(ObjectName pName, String pAttribute)
isAttributeWriteAllowed
in interface Restrictor
pName
- MBean namepAttribute
- attribute to checkpublic boolean isOperationAllowed(ObjectName pName, String pOperation)
isOperationAllowed
in interface Restrictor
pName
- MBean namepOperation
- attribute to checkCopyright © 2017. All rights reserved.