public class RblSecurityManager extends Object
This class implements an IP-based permission scheme. Permissions are read from a file in format
addr = permission
| Modifier and Type | Field and Description |
|---|---|
static String |
ALL_PERMISSION
The string value representing all permissions
|
static String |
BLOCK_PERMISSION
The string value of permission 'block'
|
static String[] |
PERMISSIONS
This is the list of all available (assignable) permissions
|
static String |
UNBLOCK_PERMISSION
The string value of permission 'unblock'
|
| Modifier and Type | Method and Description |
|---|---|
static RblSecurityManager |
getInstance()
This method returns the global RblSecurityManager instance.
|
boolean |
hasPermission(InetAddress addr,
String perm)
Checks whether the given address
addr has the specified
permission. |
void |
readPermissions(File file) |
void |
readPermissions(InputStream inputStream)
Parse the given file and store all permissions in the global hash.
|
public static final String BLOCK_PERMISSION
public static final String UNBLOCK_PERMISSION
public static final String ALL_PERMISSION
public static final String[] PERMISSIONS
public static RblSecurityManager getInstance()
public void readPermissions(InputStream inputStream) throws Exception
file - Exceptionpublic boolean hasPermission(InetAddress addr, String perm)
Checks whether the given address addr has the specified
permission.
addr - The address to check.perm - The permission which is queried for this address.Copyright © 2013. All Rights Reserved.