Properties
| Property | Type | Description |
|---|---|---|
| precedence | String | The precedence of operations (i. |
Methods
| Method | Returns | Description |
|---|---|---|
| add() | Config2_IPFilterRule | Adds an IP filter rule. |
| get() | Config2_IPFilterRule | Returns an Config2_IPFilterRule object for the given ID. |
| remove() | void | Deletes the given IP filter rule. |
| test() | Object | Test an IP address against the filter rules. |
| toArray() | Array.<Config2_IPFilterRule> | Returns an array of Config2_IPFilterRule objects representing all existing IP filter rules. |
Property Details
precedence :String
- Description:
The precedence of operations (i.e. 'DenyOverAllow' or 'AllowOverDeny').
The precedence of operations (i.e. 'DenyOverAllow' or 'AllowOverDeny').
Type:
- String
Method Details
add(action, host, user) → {Config2_IPFilterRule}
- Description:
Adds an IP filter rule.
Parameters:
| Name | Type | Description |
|---|---|---|
action |
String | The action of the rule (i.e. 'Deny', 'Allow' or 'AllowAlways'). |
host |
String | The mask of the rule. Rules with no mask defined apply to all IP addresses. |
user |
String | Config2_User | Name or a Config2_User object of the user that the rule applies to. Rules with no user defined apply to all users. |
Returns:
The created rule object.
- Type
- Config2_IPFilterRule
get(id) → {Config2_IPFilterRule|null}
- Description:
Returns an Config2_IPFilterRule object for the given ID.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
String | ID of the IP filter rule. |
Returns:
Rule object or null if not found.
- Type
- Config2_IPFilterRule | null
remove(id)
- Description:
Deletes the given IP filter rule.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
String | Config2_IPFilterRule | ID or an Config2_IPFilterRule object of the rule to be deleted. |
test(ip, user) → {Object}
- Description:
Test an IP address against the filter rules.
Parameters:
| Name | Type | Description |
|---|---|---|
ip |
String | IP address to test. |
user |
Object | User context. |
Returns:
Test result with action and reason.
- Type
- Object
toArray() → {Array.<Config2_IPFilterRule>}
- Description:
Returns an array of Config2_IPFilterRule objects representing all existing IP filter rules.
Returns:
Array of all rule objects.
- Type
- Array.<Config2_IPFilterRule>