public class RuleSet extends Object implements EventLoggerProvider
Modifier and Type | Field and Description |
---|---|
static List<String> |
CONFIG_PROPERTIES |
static String |
DEFAULT_ALLOW |
static String |
DEFAULT_DENY |
Constructor and Description |
---|
RuleSet(EventLoggerProvider eventLogger) |
Modifier and Type | Method and Description |
---|---|
void |
addRule(Integer number,
String identity,
Permission permission,
AclAction action) |
Result |
check(Subject subject,
Operation operation,
ObjectType objectType,
ObjectProperties properties)
Checks for the case when the client's address is not known.
|
Result |
check(Subject subject,
Operation operation,
ObjectType objectType,
ObjectProperties properties,
InetAddress addressOfClient)
Check the authorisation granted to a particular identity for an operation on an object type with
specific properties.
|
protected boolean |
checkName(String name)
Return true if the name is well-formed (contains legal characters).
|
void |
clear()
Clear the contents, including acl rules and configuration.
|
void |
configure(Map<String,Boolean> properties)
Configure properties for the plugin instance.
|
void |
configure(String key,
Boolean value)
Configure a single property for the plugin instance.
|
void |
disableRule(int ruleNumber) |
void |
enableRule(int ruleNumber) |
Map<Integer,Rule> |
getAllRules()
Returns all rules in the
RuleSet . |
Result |
getDefault()
Default deny.
|
EventLogger |
getEventLogger() |
int |
getRuleCount() |
List<Rule> |
getRules(Subject subject,
Operation operation,
ObjectType objectType)
Filtered rules list based on a subject and operation.
|
void |
grant(Integer number,
String identity,
Permission permission,
Operation operation) |
void |
grant(Integer number,
String identity,
Permission permission,
Operation operation,
ObjectType object,
AclRulePredicates predicates) |
void |
grant(Integer number,
String identity,
Permission permission,
Operation operation,
ObjectType object,
ObjectProperties properties) |
protected boolean |
isSet(String key)
Check if a configuration property is set.
|
boolean |
isValidNumber(Integer number) |
protected boolean |
isvalidUserName(String name)
Returns true if a username has the name[@domain][/realm] format
|
boolean |
ruleExists(String identity,
AclAction action) |
public static final String DEFAULT_ALLOW
public static final String DEFAULT_DENY
public RuleSet(EventLoggerProvider eventLogger)
public void clear()
public int getRuleCount()
public List<Rule> getRules(Subject subject, Operation operation, ObjectType objectType)
public boolean isValidNumber(Integer number)
public void grant(Integer number, String identity, Permission permission, Operation operation)
public void grant(Integer number, String identity, Permission permission, Operation operation, ObjectType object, ObjectProperties properties)
public void grant(Integer number, String identity, Permission permission, Operation operation, ObjectType object, AclRulePredicates predicates)
public void addRule(Integer number, String identity, Permission permission, AclAction action)
public void enableRule(int ruleNumber)
public void disableRule(int ruleNumber)
protected boolean checkName(String name)
protected boolean isvalidUserName(String name)
public Result check(Subject subject, Operation operation, ObjectType objectType, ObjectProperties properties)
public Result check(Subject subject, Operation operation, ObjectType objectType, ObjectProperties properties, InetAddress addressOfClient)
public Result getDefault()
protected boolean isSet(String key)
public void configure(Map<String,Boolean> properties)
properties
- public void configure(String key, Boolean value)
key
- value
- public Map<Integer,Rule> getAllRules()
RuleSet
. Primarily intended to support unit-testing.public EventLogger getEventLogger()
getEventLogger
in interface EventLoggerProvider
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.