A whitelist explicitly allows methods/properties for a class;
A blacklist explicitly forbids methods/properties for a class;
Permissions are composed of three lists, read, write, execute, each being "white" or "black":
| Modifier and Type | Class and Description |
|---|---|
| public static class | Sandbox.BlackSet
A black set of names. |
| public abstract static class | Sandbox.Names
A base set of names. |
| public static class | Sandbox.Permissions
Contains the white or black lists for properties and methods for a given class. |
| public static class | Sandbox.WhiteSet
A white set of names. |
| Modifier and Type | Field and Description |
|---|---|
| private static final Sandbox. | ALL_WHITE
The pass-thru permissions. |
| private final Map | sandbox
The map from class names to permissions. |
| private static final Sandbox. | WHITE_NAMES
The pass-thru name set. |
| Access | Constructor and Description |
|---|---|
| public | |
| protected | Sandbox(Map<String, Sandbox.
the permissions map mapCreates a sandbox based on an existing permissions map. |
| Modifier and Type | Method and Description |
|---|---|
| public Sandbox. | |
| public String | |
| public String | |
| public Sandbox. | |
| public Sandbox. | Returns: the set of permissionsthe class for which these permissions apply clazz, boolean whether the readable property list is white - true - or black - false - readFlag, boolean whether the writeable property list is white - true - or black - false - writeFlag, boolean whether the executable method list is white white - true - or black - false - executeFlag)Creates the set of permissions for a given class. |
| public String | |
| public String | |
| public Sandbox. | |
| public String | |
| public String |
| ALL_WHITE | back to summary |
|---|---|
| private static final Sandbox. The pass-thru permissions. | |
| sandbox | back to summary |
|---|---|
| private final Map<String, Sandbox. The map from class names to permissions. | |
| WHITE_NAMES | back to summary |
|---|---|
| private static final Sandbox. The pass-thru name set. | |
| Sandbox | back to summary |
|---|---|
| public Sandbox() Creates a new default sandbox. | |
| Sandbox | back to summary |
|---|---|
| protected Sandbox(Map<String, Sandbox. Creates a sandbox based on an existing permissions map.
| |
| black | back to summary |
|---|---|
| public Sandbox. Creates a new set of permissions based on black lists for methods and properties for a given class.
| |
| execute | back to summary |
|---|---|
| public String execute(Class<?> clazz, String name) Gets the execute permission value for a given method of a class. | |
| execute | back to summary |
|---|---|
| public String execute(String clazz, String name) Gets the execute permission value for a given method of a class. | |
| get | back to summary |
|---|---|
| public Sandbox. Gets the set of permissions associated to a class.
| |
| permissions | back to summary |
|---|---|
| public Sandbox. Creates the set of permissions for a given class.
| |
| read | back to summary |
|---|---|
| public String read(Class<?> clazz, String name) Gets the read permission value for a given property of a class. | |
| read | back to summary |
|---|---|
| public String read(String clazz, String name) Gets the read permission value for a given property of a class. | |
| white | back to summary |
|---|---|
| public Sandbox. Creates a new set of permissions based on white lists for methods and properties for a given class.
| |
| write | back to summary |
|---|---|
| public String write(Class<?> clazz, String name) Gets the write permission value for a given property of a class. | |
| write | back to summary |
|---|---|
| public String write(String clazz, String name) Gets the write permission value for a given property of a class. | |
| Modifier and Type | Field and Description |
|---|---|
| private Set | names
The set of controlled names. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(String
the name to add name)Implements abstract org. |
| public String | get(String
the method/property name to check name)Overrides org. |
| names | back to summary |
|---|---|
| private Set<String> names The set of controlled names. | |
| BlackSet | back to summary |
|---|---|
| public BlackSet() | |
| add | back to summary |
|---|---|
| public boolean add(String name) Implements abstract org. Doc from org. Adds a name to this set. | |
| get | back to summary |
|---|---|
| public String get(String name) Overrides org. Doc from org. Whether a given name is allowed or not. | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract boolean | |
| public boolean | |
| public String |
| Names | back to summary |
|---|---|
| public Names() | |
| add | back to summary |
|---|---|
| public abstract boolean add(String name) Adds a name to this set.
| |
| alias | back to summary |
|---|---|
| public boolean alias(String name, String alias) Adds an alias to a name to this set. This only has an effect on white lists. | |
| get | back to summary |
|---|---|
| public String get(String name) Whether a given name is allowed or not. | |
| Modifier and Type | Field and Description |
|---|---|
| private final Sandbox. | execute
The controlled methods. |
| private final Sandbox. | read
The controlled readable properties. |
| private final Sandbox. | write
The controlled writeable properties. |
| Access | Constructor and Description |
|---|---|
| pack-priv | Permissions(boolean
whether the read property list is white or black readFlag, boolean whether the write property list is white or black writeFlag, boolean whether the method list is white of black executeFlag)Creates a new permissions instance. |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Sandbox. | |
| public Sandbox. | |
| public Sandbox. | |
| public Sandbox. | Returns: the set of property namesGets the set of readable property names in these permissions. |
| public Sandbox. | |
| public Sandbox. | Returns: the set of property namesGets the set of writeable property names in these permissions. |
| execute | back to summary |
|---|---|
| private final Sandbox. The controlled methods. | |
| read | back to summary |
|---|---|
| private final Sandbox. The controlled readable properties. | |
| write | back to summary |
|---|---|
| private final Sandbox. The controlled writeable properties. | |
| Permissions | back to summary |
|---|---|
| pack-priv Permissions(boolean readFlag, boolean writeFlag, boolean executeFlag) Creates a new permissions instance.
| |
| Permissions | back to summary |
|---|---|
| pack-priv Permissions(Sandbox. Creates a new permissions instance. | |
| execute | back to summary |
|---|---|
| public Sandbox. Adds a list of executable methods names to these permissions. The constructor is denoted as the empty-string, all other methods by their names.
| |
| execute | back to summary |
|---|---|
| public Sandbox. Gets the set of method names in these permissions. | |
| read | back to summary |
|---|---|
| public Sandbox. Adds a list of readable property names to these permissions.
| |
| read | back to summary |
|---|---|
| public Sandbox. Gets the set of readable property names in these permissions. | |
| write | back to summary |
|---|---|
| public Sandbox. Adds a list of writeable property names to these permissions.
| |
| write | back to summary |
|---|---|
| public Sandbox. Gets the set of writeable property names in these permissions. | |
| Modifier and Type | Field and Description |
|---|---|
| private Map | names
The map of controlled names and aliases. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(String
the name to add name)Implements abstract org. |
| public boolean | alias(String
the name to alias name, String the alias alias)Overrides org. |
| public String | get(String
the method/property name to check name)Overrides org. |
| names | back to summary |
|---|---|
| private Map<String, String> names The map of controlled names and aliases. | |
| WhiteSet | back to summary |
|---|---|
| public WhiteSet() | |
| add | back to summary |
|---|---|
| public boolean add(String name) Implements abstract org. Doc from org. Adds a name to this set. | |
| alias | back to summary |
|---|---|
| public boolean alias(String name, String alias) Overrides org. Doc from org. Adds an alias to a name to this set. This only has an effect on white lists. | |
| get | back to summary |
|---|---|
| public String get(String name) Overrides org. Doc from org. Whether a given name is allowed or not. | |